Layout
Content
A row that lines up an icon, a title with a description under it, and actions at the end. Use it for the header of a block, a settings row, an empty state or an item in a list; it has no border, background or padding of its own, so it goes inside whatever box holds it. tk:alert, tk:section, tk:status and tk:avatar.profile are built on it.
Nothing to show
The icon sits at the start of the row. The title, in bold, and the muted description under it fill the rest of the width. With two lines of text the icon aligns with the top of the title instead of the middle of the block.
Actions #
The actions slot is placed at the end of the row and keeps its width while the text wraps. Clicking Enable calls the Livewire action.
Two-factor authentication
Nothing to show
Body text and lists #
The default slot renders as a paragraph under the title. An array description renders as a bulleted list, which comes after the default slot.
Nothing to show
Custom icon #
The icon slot takes any content in place of an icon name, here the avatar with her initials, in the same spot at the start of the row.
Nothing to show
Rendering from data #
One row per member, separated by a line, with the role at the end of each row.
Ana Souza
Bruno Lima
Carla Mendes
Nothing to show
Sizes #
size sets the font size and the spacing, and is passed to the icon, title and texts.
Documents
Documents
Documents
Documents
Nothing to show
Prepend and append #
prepend goes above the title and append under the description, inside the text column.
Launch checklist
Nothing to show
Customization #
Classes go to the row; title:, description:, icon:, actions: and container: reach the parts. title:level makes the title a real heading.
Billing
Nothing to show
Reference
Content
| Prop | Type | Default | Description |
|---|---|---|---|
title |
string | slot | null |
The title, in bold, translated. |
description |
string | array | slot | null |
Muted text under the title, translated. An array renders as a bulleted list. |
icon |
string | slot | null |
An icon name, or any content, at the start of the row. |
prepend |
slot | null |
Content above the title. |
append |
slot | null |
Content under the description and the body. |
actions |
slot | null |
Content at the end of the row, such as buttons or a badge. |
size |
string | md |
xs, sm, md, lg, xl, 2xl or 3xl. Sets the font size and the spacing, and is passed to the icon, title and texts. |
Slots
| Slot | Description |
|---|---|
| default | Text under the description, in the same muted style. |
actions |
Content at the end of the row. |
prepend, append |
Content above the title / at the end of the text column. |
Prefixes
| Prefix | Goes to |
|---|---|
icon: |
The icon, or the element wrapping the icon slot. |
container: |
The column holding prepend, title, description, body and append. |
title: |
The title. It is a <p>; title:level="2" makes it an <h2>. title:icon and title:badge add an icon and a badge to it. |
description: |
The description text and the paragraph of the default slot. |
list: |
The list, when description is an array. list:item: reaches each item's text. |
actions: |
The element wrapping the actions. |
Slots
title, description and icon also accept a slot in place of the prop.
Customization
Classes and attributes go to the row's <div>. To reach an inner element, prefix the attribute (listed in the Reference above).
Nothing to show
Accessibility
The row is a plain <div> with no role and no keyboard interaction. The title is a <p>: pass title:level to make it a real heading when the row heads a part of the page. The icon is hidden from screen readers (aria-hidden); icon:aria-label names it and gives it role="img". The icon slot is wrapped in an element hidden the same way: icon:aria-label removes the aria-hidden and puts the label on that wrapper, which has no role, so when the content must be announced give it a name of its own.
Behavior notes
- When the row has no icon, title, description, prepend, append, actions or default slot, nothing renders, not even the
<div>with its attributes. - The icon and the actions are centered on the text when the column has a single part (only a title, for example), and aligned to its top when it has two or more.
- The default slot is wrapped in a
<p>, like the description. Give it inline content: a<div>or a list inside it ends the paragraph early in the browser. - The
description:attributes go to both the description and the default slot's paragraph; anidstays only on the description. - A string
titleordescriptionwith line breaks keeps them.description="0"renders0;falserenders nothing. - Inside Livewire it has no state of its own: every update renders it again from the props.
Related
tk:avatar.profile puts the person's avatar, name and email in this row.
Section
a header row like this one, with the content of the section under it.
Heading
the title or the description alone, without the row.
Text
the title or the description alone, without the row.