コンポーネント詳細

Container

Width and padding container wrapper.

サンプル

参照情報

テンプレート
templates/components/container.html
ゴールデン
testdata/golden/container.golden.html

Go(Marionette)サンプル

この実装例は Go の Marionette を使っています。ソース: 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."})),
		)
	})
}