Data display
List
A bulleted or numbered list, from an array of texts or from <li> elements written in the slot. Use it for short lists in body text, such as requirements or steps.
Nothing to show
A <ul> with three bulleted items, each in the body text style. The bullets sit inside the text column, aligned with the paragraphs around it.
Numbered #
An <ol> numbered 1, 2, 3.
Nothing to show
Items written by hand #
The slot takes <li> elements with any content; here a link per file, with no marker and some space between items.
Nothing to show
Sizes #
size sets the size of the item texts.
Nothing to show
Livewire data #
items re-renders with the component state.
Nothing to show
Customization #
item: attributes go to the text of each item (a tk:text), and li: to each <li>.
Nothing to show
Reference
tk:list
| Prop | Type | Default | Description |
|---|---|---|---|
items |
array | Collection | null |
The item texts, each translated. |
marker |
string | disc |
disc for bullets, decimal for numbers (an <ol>), none for no marker. |
size |
string | md |
xs, sm, md, lg, xl, 2xl or 3xl. Sets the size of the item texts. |
Slots
| Slot | Description |
|---|---|
| default | <li> elements, rendered before the items. |
Prefixes
| Prefix | Goes to |
|---|---|
li: |
Each <li>. |
item: |
The text inside each item, a tk:text (item:variant="subtle", item:icon="mdi:check"...). |
Customization
Classes and attributes go to the <ul> or <ol>. To reach the items from items, prefix the attribute (listed in the Reference above).
Nothing to show
Accessibility
A native list, so screen readers announce the number of items. With marker="none" it also has role="list", because Safari stops announcing lists whose markers are removed by CSS.
Behavior notes
- With no
itemsand no slot content, nothing is rendered. - Each item from
itemsis translated, like the labels of the other components. - Without
item:icon, the text of each item fromitemsis inline: the marker stays on its first line and a long text wraps under the marker. Withitem:icon, the icon and the text form one inline-flex box, so a text too long to fit beside the marker moves to the line below it.