コンポーネント詳細

TextComponent

Semantic text helper with size, weight, and tone options.

サンプル

参照情報

テンプレート
frontend/ui_impl.go
ゴールデン
N/A

Go(Marionette)サンプル

この実装例は Go の Marionette を使っています。ソース: docs/site-astro/public/examples/go/text-component.go

package goexamples

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

func RegisterTextComponentExample(app *mb.App) {
	app.Page("/text-component", func(ctx *mb.Context) mf.Node {
		return mf.Stack(mf.StackProps{Gap: "sm"},
			mf.TextComponent(mf.TextProps{Text: "Display text", Size: "xl", Weight: "semibold"}),
			mf.TextComponent(mf.TextProps{Text: "Supportive body copy", Tone: "muted"}),
		)
	})
}