mirror of
https://github.com/eduardolat/pgbackweb.git
synced 2026-01-24 05:28:36 -06:00
Add CardBox component
This commit is contained in:
22
internal/view/web/component/card_box.go
Normal file
22
internal/view/web/component/card_box.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package component
|
||||
|
||||
import (
|
||||
"github.com/maragudk/gomponents"
|
||||
"github.com/maragudk/gomponents/components"
|
||||
"github.com/maragudk/gomponents/html"
|
||||
)
|
||||
|
||||
type CardBoxParams struct {
|
||||
Class string
|
||||
Children []gomponents.Node
|
||||
}
|
||||
|
||||
func CardBox(params CardBoxParams) gomponents.Node {
|
||||
return html.Div(
|
||||
components.Classes{
|
||||
"rounded-box shadow-md bg-base-100 p-4": true,
|
||||
params.Class: true,
|
||||
},
|
||||
gomponents.Group(params.Children),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user