Forms
Legend
The title of a <fieldset>, styled as a heading. tk:fieldset renders it from its label; write the tag yourself inside a fieldset of your own, or when the title needs markup the label prop cannot carry.
Nothing to show
A <legend> with "Shipping address" in the heading style (extra-bold, two steps above body text), which names the fieldset for screen readers.
With an icon and a badge #
The icon before the title and the badge after it, vertically centered on the line.
Nothing to show
Sizes #
size comes from tk:heading, from xs to 3xl; scale sets how far above body text it is.
Nothing to show
Variants and colors #
variant picks the neutral color (strong, subtle, accent) and color any palette color.
Nothing to show
Dimmed when disabled #
Inside a disabled tk:fieldset the legend is dimmed together with the fields.
Nothing to show
Customization #
Classes go to the <legend>; the parts take the element prefixes, such as icon:class.
Nothing to show
Reference
tk:legend
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string | slot | null |
The title, translated. The default slot takes its place. |
Also accepts the element props (icon, badge, suffix...) and the props of tk:heading (size, scale, variant, color).
Slots
| Slot | Description |
|---|---|
| default | The title, in place of label. |
Customization
Classes and attributes go to the <legend> element; the parts take the prefixes of the element props (icon:, badge:...).
Nothing to show
Accessibility
A native <legend>: as the first child of a <fieldset>, it names the group, and screen readers announce it when focus enters any field inside.
Behavior notes
- With no label, no slot content and no other part (icon, badge...), nothing is rendered.
- It is dimmed while its
tk:fieldsetis disabled.