Item
Settings screens, member lists and account pages are made of one row: a title, a sentence under it, sometimes an avatar or an icon before it, and a button, a switch or a value at its end. item is that row, and item.group stacks several of them into one bordered list with a rule between them.
Ask for a code from an app on your phone at every sign-in.
Without a description
The description is optional. Without it the item is a single line, and it is still as tall as a small button, so a row with a button and a row without one stand at the same height.
-
PlanPro
-
Invoices
Actions
The actions slot sits at the end of the row, centered on the title and the description beside it. Several controls stand side by side and wrap among themselves when the row runs out.
Created on March 4. Used two hours ago.
Media
The media slot leads the row: an avatar, an icon tile or anything else that says what the row is about. It sits at the start, centered on the text beside it.
-
Ada Lovelace
ada@example.com
Owner -
Weekly summary
A mail every Monday with what changed last week.
Groups
item.group draws one frame around its items and a rule between them, and an item inside it draws no frame of its own. The group is a list for assistive technology, so give it a name with label: a settings screen with a group per section otherwise reads as a run of identical lists.
-
Password
Last changed three months ago.
-
Two-factor authentication
On, with an authenticator app.
On -
Active sessions
Signed in on two devices.
Narrow widths
On a narrow item a labeled button moves under the text, so the title keeps its width. A switch, a badge, a value, a menu and an icon button stay at the end of the row, where they fit beside a short title.
The item goes by its own width, not the window's: below 24rem of item the button moves, so an item in a modal, in a sidebar or in a column of a grid does the same as one on a phone.
A copy of every project each night.
A mail for every sign-in from a new device.
stack-below moves every action under the text below the width it names, whatever the actions hold:
<x-wirekit::item title="Storage" description="12 GB of 50 GB used." stack-below="md">
<x-slot:actions>
<x-wirekit::badge>Pro</x-wirekit::badge>
<x-wirekit::button size="sm">Upgrade</x-wirekit::button>
</x-slot:actions>
</x-wirekit::item>
The width is the item's own, and the scale says so. stack-below reads Tailwind's container ladder, which shares its names with the viewport one and not its meanings: stack-below="sm" is 24rem of item, where a viewport sm is 40rem of window. Pick the size from how wide the item itself gets, never from a screen width.
Naming a switch with its title
A switch at the end of a row needs a name, and the title beside it already says it. for takes the id of the control in actions and renders the title as its <label>: a screen reader announces the switch by the visible title, and a click on the title flips it.
With for, the description gets the id {for}-description, so the control can name it with aria-describedby without an id being made up for it.
A banner for every new message while the app is open.
for is for a form control: a switch, a checkbox, a select or an input. Never point it at a button: a <label> in front of a button presses that button on every click on the title, and a button names itself with its own label. A control named by the title must not take a label of its own, or a screen reader hears the name twice.
A title that starts a section
The title is not a heading, so a list of thirty members does not put thirty entries into the outline of the page. level makes it a heading of that level, for a row that is a section of its own.
Delete this workspace
Every project, member and invoice is deleted. This cannot be undone.
Inside a card
A card draws a frame of its own, and an item or a group inside it would draw a second one. surface="ghost" draws neither the frame nor the background and keeps the rules between the rows of a group. Put the group in a card.body with :padded="false": each item brings its own padding, and the rules between the rows reach the edges of the card.
-
Language
English
-
Time zone
Europe/Berlin
In a form
Alone, a ghost item keeps no padding either, so a switch row lines up with the fields above it instead of standing a step inside them.
Visible to customers as soon as it is saved.
Examples
Team members
-
Ada Lovelace
ada@example.com
-
Grace Hopper
grace@example.com
Owner
Connected apps
-
Code host
Last used today.
-
Team chat
Last used three weeks ago.
Billing
-
Plan
Pro, billed yearly.
€240 a year
-
Payment method
Card ending in 4242, expires 08/28.
Teams
-
Design
Eight members.
Current -
Platform
Fourteen members.
Notifications
-
When someone mentions you in a comment.
-
A summary of the week, every Monday morning.
-
New features, at most once a month.
Danger zone
-
Leave the workspace
You lose access to its projects until someone invites you again.
-
Delete the workspace
Every project, member and invoice is deleted. This cannot be undone.
Configuration
surface reads its default from the config, for an item that stands alone and for a group alike. Override it in config/:
'components' => [
'item' => ['surface' => 'ghost'],
],
Personalization blocks
The parts of the row are resolvable through WireKit:: / WireKit::, and a config override under components. reaches the same keys:
| Block key | Applies to |
|---|---|
item.base |
The item itself: its container query, width, padding and text color |
item.surface |
The frame, background and corners of an item that stands alone with surface="outline" |
item.row |
The grid of the media, the text and the actions, its gaps and its minimum height |
item.media |
The cell of the media slot |
item.content |
The cell of the title and the description |
item.actions |
The actions slot, its alignment and the gap between its controls |
item.title |
The title's size, weight and color |
item-group.base |
The group's list, its rules between rows and, with surface="outline", its frame |
Props
item
| Prop | Type | Default | Description |
|---|---|---|---|
title |
string|null |
null |
The row's title. The default slot says the same thing and wins when both are given |
description |
string|null |
null |
A line of supporting text under the title. A description slot takes the same place when the text needs markup |
level |
int|null |
null |
Render the title as a heading of this level, 1 to 6. Without it the title is not a heading — see A title that starts a section |
for |
string|null |
null |
The id of the form control in actions that the title names; the title renders as its <label> — see Naming a switch with its title |
title-id |
string|null |
null |
The title's id. With for it defaults to {for}-title |
description-id |
string|null |
null |
The description's id. With for it defaults to {for}-description |
stack-below |
string|null |
null |
Put every action under the text below a width of the item: 'sm', 'md', 'lg', 'xl', '2xl' or '3xl' on Tailwind's container ladder — see Narrow widths |
surface |
string |
'outline' |
outline draws a frame with rounded corners on the elevated background. ghost draws neither and, on an item alone, no padding, so it lines up with what stands beside it — see In a form. Inside a group the group draws the surface, every row keeps its padding, and this prop has no effect |
scope |
string|null |
null |
Theme scope, as everywhere else |
item.group
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string|null |
null |
The list's accessible name. aria-label or aria-labelledby on the tag take its place |
surface |
string |
'outline' |
outline draws one frame around all of the rows, ghost only the rules between them |
scope |
string|null |
null |
Theme scope, as everywhere else |
Slots
| Slot | Description |
|---|---|
| default | The title, when it carries markup |
description |
The line under the title, when it carries markup |
media |
An avatar, an icon tile or anything else that leads the row |
actions |
Buttons, a switch, a badge, a value or a menu, at the end of the row |
Accessibility
- An item in a group is an
<li>of a<ul role="list">. The role is there on purpose: Safari drops the semantics of a list drawn without markers - Name each group with
label, or pointaria-labelledbyat a heading above it. A screen with several unnamed lists reads as a run of "list, 3 items" formakes the visible title the name of the switch, checkbox, select or input inactions, andaria-describedby="{for}-description"adds the description to what is announced with it- The title is a heading only with
level. Set it where a row is a section of the page, not on every row of a list - An icon button in
actionskeeps its label visually hidden withicon-only, so it still has a name
Keyboard Interaction
The item renders no interactive element of its own: it is a title, a line of text and whatever you put in media and actions. Those controls keep their own keyboard behavior and their own place in the tab order, in the order the markup puts them.
See Also
- Page Header — the one title of a screen, with its own actions
- Data List — a list of keys and their values
- Toggle — the switch a settings row usually holds
- Card — the frame a group of items often sits in