KwikAccordion

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.

headerIcon

: The icon to display on the left side of the title.

containerColor

: 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.

headerTextColor

: The color of the title.

isError

: If true, the accordion will display an error icon.

errorIcon

: The icon to display when isError is true.

onExpandedChange

: 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")
}