Component Detail
Card
Card surface with optional header metadata.
Example
References
- Template
templates/components/card.html- Golden
testdata/golden/card.golden.html
Go (Marionette) Example
This implementation example uses Marionette in Go. Source: docs/site-astro/public/examples/go/card.go
package goexamples
import (
mb "github.com/YoshihideShirai/marionette/backend"
mf "github.com/YoshihideShirai/marionette/frontend"
)
func RegisterCardExample(app *mb.App) {
app.Page("/card", func(ctx *mb.Context) mf.Node {
return mf.Card(mf.CardProps{
Title: "Workspace summary",
Description: "Header, description, actions, then body content.",
Actions: mf.Button("Edit", mf.ComponentProps{Variant: "ghost", Size: "sm"}),
}, mf.TextComponent(mf.TextProps{Text: "Ready"}))
})
}