Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created March 31, 2026 00:59
Show Gist options
  • Select an option

  • Save skydoves/0fa4549b85efa1aec7531c4a603b7914 to your computer and use it in GitHub Desktop.

Select an option

Save skydoves/0fa4549b85efa1aec7531c4a603b7914 to your computer and use it in GitHub Desktop.
Compose HotSwan - Adding new composable functions
@Composable
fun ProfileCard(user: User) {
Column {
UserAvatar(user) // New composable, defined below
Text(text = user.name)
}
}
@Composable
fun UserAvatar(user: User) {
Image(
painter = painterResource(id = R.drawable.avatar),
contentDescription = null,
modifier = Modifier.size(48.dp)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment