From e12c1c9ff8e8855f00eadbe3ed884999527ec3cf Mon Sep 17 00:00:00 2001 From: Luca Spinazzola Date: Mon, 9 Jan 2023 19:06:08 -0500 Subject: [PATCH] Allow for the configuration of card header, footer, body attrs (#296) --- src/main/kotlin/app/softwork/bootstrapcompose/Card.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/app/softwork/bootstrapcompose/Card.kt b/src/main/kotlin/app/softwork/bootstrapcompose/Card.kt index 342ee7c..7113248 100644 --- a/src/main/kotlin/app/softwork/bootstrapcompose/Card.kt +++ b/src/main/kotlin/app/softwork/bootstrapcompose/Card.kt @@ -8,8 +8,11 @@ import org.w3c.dom.* public fun Card( styling: (Styling.() -> Unit)? = null, attrs: AttrBuilderContext? = null, + headerAttrs: AttrBuilderContext? = null, header: ContentBuilder? = null, + footerAttrs: AttrBuilderContext? = null, footer: ContentBuilder? = null, + bodyAttrs: AttrBuilderContext? = null, body: ContentBuilder ) { Style @@ -25,11 +28,11 @@ public fun Card( attrs?.invoke(this) }) { header?.let { - Div({ classes("card-header") }, header) + Div({ classes("card-header"); headerAttrs?.invoke(this) }, header) } - Div({ classes("card-body") }, body) + Div({ classes("card-body"); bodyAttrs?.invoke(this) }, body) footer?.let { - Div({ classes("card-footer") }, footer) + Div({ classes("card-footer"); footerAttrs?.invoke(this) }, footer) } } }