Layout
Text
A paragraph of body text in the type scale and colors of the other components, for descriptions, hints and captions. It takes the element props, so it can carry an icon or a badge, and renders nothing when it has no content.
Nothing to show
A <p> in the base size and the default text color (lighter in dark mode). The label is translated, and line breaks in it are kept.
Sizes, weights and colors #
Small muted text; bold, darker text; red text with an icon before it.
Nothing to show
Inside other markup #
as renders another element, here a <span> inside a line; the slot takes the place of label and is not translated.
Nothing to show
Sizes #
size sets the font and icon size, from xs to 3xl.
Nothing to show
Scale #
scale moves the font size one or two steps from size (smallest, small, large, largest).
Nothing to show
Accent and other colors #
The accent variant follows the theme accent; color takes any palette color and wins over variant.
Nothing to show
Icons, badges and info #
The element props work on text: icon, badge, suffix, and info for a help icon with a tooltip.
Nothing to show
Bound text #
The text follows Livewire state and keeps the line breaks of the label. Type in the textarea to update it.
Nothing to show
Rendering from data #
One line per payment, with a color picked from its status. as=span renders the amount inline.
Nothing to show
Customization #
Classes go to the element; the parts take the prefixes of the element props (icon:, badge:...).
Nothing to show
Reference
tk:text
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string | slot | null |
The text, translated. The default slot takes its place. |
size |
string | md |
xs, sm, md, lg, xl, 2xl or 3xl. Sets the font and icon size. |
scale |
string | null |
smallest, small, large or largest: moves the font size one or two steps from size. |
weight |
bool | false |
Uses the heavier weight of the size. |
variant |
string | default | strong (darker), subtle (muted), accent (the accent color), none (no color class), or the default body color. |
color |
string | null |
A color name (red, green...). Takes precedence over variant. |
info |
string | null |
A help icon at the end, with this text as its tooltip (info: reaches the icon). |
Also accepts the element props (icon, badge, suffix...) and as for the element to render (p by default; href makes it a link).
Slots
| Slot | Description |
|---|---|
| default | The text, in place of label. |
Customization
Classes and attributes go to the element; the parts take the prefixes of the element props (icon:, badge:...).
Nothing to show
Accessibility
Plain text in a <p>; read in order. A paragraph that names something (a field, a section) should be linked to it with aria-describedby, as the field props do for their description and help.
Behavior notes
- With no label, no slot content and no other part (icon, badge...), nothing is rendered.
- A
tk:textright after atk:headinggets a small gap above it.