Component Detail

Container

Width and padding container wrapper.

Example

References

Template
templates/components/container.html
Golden
testdata/golden/container.golden.html

Go (Marionette) Example

This implementation example uses Marionette in Go. Source: docs/site-astro/public/examples/go/container.go

package goexamples

import (
	mb "github.com/YoshihideShirai/marionette/backend"
	mf "github.com/YoshihideShirai/marionette/frontend"
)

func RegisterContainerExample(app *mb.App) {
	app.Page("/container", func(ctx *mb.Context) mf.Node {
		return mf.Container(
			mf.ContainerProps{MaxWidth: "md", Padding: "lg", Centered: true},
			mf.Card(mf.CardProps{Title: "Contained content"}, mf.TextComponent(mf.TextProps{Text: "Centered page section."})),
		)
	})
}