Skip to content

Commit e12c1c9

Browse files
authored
Allow for the configuration of card header, footer, body attrs (#296)
1 parent f49eea1 commit e12c1c9

File tree

1 file changed

+6
-3
lines changed
  • src/main/kotlin/app/softwork/bootstrapcompose

1 file changed

+6
-3
lines changed

src/main/kotlin/app/softwork/bootstrapcompose/Card.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ import org.w3c.dom.*
88
public fun Card(
99
styling: (Styling.() -> Unit)? = null,
1010
attrs: AttrBuilderContext<HTMLDivElement>? = null,
11+
headerAttrs: AttrBuilderContext<HTMLDivElement>? = null,
1112
header: ContentBuilder<HTMLDivElement>? = null,
13+
footerAttrs: AttrBuilderContext<HTMLDivElement>? = null,
1214
footer: ContentBuilder<HTMLDivElement>? = null,
15+
bodyAttrs: AttrBuilderContext<HTMLDivElement>? = null,
1316
body: ContentBuilder<HTMLDivElement>
1417
) {
1518
Style
@@ -25,11 +28,11 @@ public fun Card(
2528
attrs?.invoke(this)
2629
}) {
2730
header?.let {
28-
Div({ classes("card-header") }, header)
31+
Div({ classes("card-header"); headerAttrs?.invoke(this) }, header)
2932
}
30-
Div({ classes("card-body") }, body)
33+
Div({ classes("card-body"); bodyAttrs?.invoke(this) }, body)
3134
footer?.let {
32-
Div({ classes("card-footer") }, footer)
35+
Div({ classes("card-footer"); footerAttrs?.invoke(this) }, footer)
3336
}
3437
}
3538
}

0 commit comments

Comments
 (0)