Kwik Accordion
fun KwikAccordion(title: String, headerIcon: Int? = null, containerColor: Color = MaterialTheme.colorScheme.surface, elevation: Int = 8, expanded: Boolean, headerTextColor: Color = MaterialTheme.colorScheme.onSurface, isError: Boolean = false, @DrawableRes errorIcon: Int? = null, onExpandedChange: (Boolean) -> Unit, content: @Composable () -> Unit)
Accordion component that can be expanded or collapsed.
Parameters
title
: The title of the accordion.
header Icon
: The icon to display on the left side of the title.
container Color
: The color of the accordion container.
elevation
: The elevation of the accordion.
expanded
: The state of the accordion. If true, the content will be visible.
header Text Color
: The color of the title.
is Error
: If true, the accordion will display an error icon.
error Icon
: The icon to display when isError is true.
on Expanded Change
: The callback that will be called when the accordion is expanded or collapsed.
content
: The content of the accordion.
Example usage:
KwikAccordion(
title = "Accordion",
headerIcon = R.drawable.icon,
expanded = true,
headerTextColor = Color.Black,
){
Text("Accordion content")
}
Content copied to clipboard