Text
Обычный текст в семантическом теге; копия передаётся вторым аргументом.
github.com/fastygo/templ/ui
Text рендерит обычный текст в семантическом теге. Копию передают вторым аргументом value.
Абзац
Текст абзаца body.
import "github.com/fastygo/templ/ui"
templ Example() {
@ui.Text(ui.TextProps{}, "Текст абзаца body.")
}
import "github.com/fastygo/templ/ui"
templ Example() {
@ui.Text(ui.TextProps{}, "Текст абзаца body.")
}
Подпись small
Вспомогательная строка.
import "github.com/fastygo/templ/ui"
templ Example() {
@ui.Text(ui.TextProps{Tag: "small", Class: "text-muted-foreground"}, "Вспомогательная строка.")
}
import "github.com/fastygo/templ/ui"
templ Example() {
@ui.Text(ui.TextProps{Tag: "small", Class: "text-muted-foreground"}, "Вспомогательная строка.")
}
Code
npm installimport "github.com/fastygo/templ/ui"
templ Example() {
@ui.Text(ui.TextProps{Tag: "code", Class: "text-sm"}, "npm install")
}
import "github.com/fastygo/templ/ui"
templ Example() {
@ui.Text(ui.TextProps{Tag: "code", Class: "text-sm"}, "npm install")
}
API
Tag · string — p | span | small | code | blockquote | em | strong | …
Class · string — Дополнительные utility-классы
value · string — Текст копии (второй аргумент компонента)