Compose Playground

Surface

A basic building block for layouts, providing styling options.

Properties
Preview
Surface
Generated Code
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.unit.dp

@Composable
fun MySurface() {
    Surface(
        modifier = Modifier.size(192.dp),
        shape = RectangleShape,
        
        color = MaterialTheme.colorScheme.surfaceVariant
    ) {
        // Content goes here
    }
}