Skip to content

Commit

Permalink
Allow for the configuration of card header, footer, body attrs (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
luca992 authored Jan 10, 2023
1 parent f49eea1 commit e12c1c9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/kotlin/app/softwork/bootstrapcompose/Card.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import org.w3c.dom.*
public fun Card(
styling: (Styling.() -> Unit)? = null,
attrs: AttrBuilderContext<HTMLDivElement>? = null,
headerAttrs: AttrBuilderContext<HTMLDivElement>? = null,
header: ContentBuilder<HTMLDivElement>? = null,
footerAttrs: AttrBuilderContext<HTMLDivElement>? = null,
footer: ContentBuilder<HTMLDivElement>? = null,
bodyAttrs: AttrBuilderContext<HTMLDivElement>? = null,
body: ContentBuilder<HTMLDivElement>
) {
Style
Expand All @@ -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)
}
}
}

0 comments on commit e12c1c9

Please sign in to comment.