Created
January 25, 2026 13:52
-
-
Save linreal/cb6f05ffca08ce927a828f2cf58bef6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Optimized: All effects in one layer, shape evaluated once | |
| @Composable | |
| fun ElegantCard(content: @Composable () -> Unit) { | |
| Card( | |
| modifier = Modifier | |
| .fillMaxWidth() | |
| .padding(16.dp) | |
| .graphicsLayer { | |
| alpha = 0.95f | |
| shape = RoundedCornerShape(12.dp) | |
| clip = true | |
| shadowElevation = 8.dp.toPx() | |
| } | |
| .background(MaterialTheme.colorScheme.surface) | |
| ) { | |
| content() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment