Item
partialkit
Components for plain HTML.
<div class="item" data-variant="outline"> <div class="item-media"> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> <path d="M4 4h16v16H4z"></path> </svg> </div> <div class="item-content"> <span class="item-title">partialkit</span> <p class="item-description">Components for plain HTML.</p> </div> <div class="item-actions"> <button class="btn btn-outline btn-sm">Open</button> </div></div><div class="item" data-variant="outline"> <div class="item-media">…</div> <div class="item-content"> <span class="item-title">partialkit</span> <p class="item-description">Components for plain HTML.</p> </div> <div class="item-actions"> <button class="btn btn-outline btn-sm">Open</button> </div></div>| Class | Part |
|---|---|
.item | The row |
.item-group | Several rows, spaced by size |
.item-media | Icon or image at the leading edge |
.item-content | Title and description |
.item-title | One line, clamped |
.item-description | Two lines, clamped |
.item-actions | Controls at the trailing edge |
.item-header / .item-footer | Full-width rows above and below |
.item-separator | A rule between rows |
| Attribute | Meaning |
|---|---|
data-variant="outline" | A visible border |
data-variant="muted" | A filled surface |
data-size="sm" / "xs" | Tighter rows, and a smaller image |
Variants
Section titled “Variants”Plain
Outline
Muted
<div class="item-group"> <div class="item">Plain</div> <div class="item" data-variant="outline">Outline</div> <div class="item" data-variant="muted">Muted</div></div>
Default
Two lines, with room to breathe.
Small
Tighter.
Extra small
Tightest.
<div class="item-group"> <div class="item" data-variant="outline"> <div class="item-content"> <span class="item-title">Default</span> <p class="item-description">Two lines, with room to breathe.</p> </div> </div> <div class="item" data-variant="outline" data-size="sm"> <div class="item-content"> <span class="item-title">Small</span> <p class="item-description">Tighter.</p> </div> </div> <div class="item" data-variant="outline" data-size="xs"> <div class="item-content"> <span class="item-title">Extra small</span> <p class="item-description">Tightest.</p> </div> </div></div>As a link
Section titled “As a link”Put the classes on an <a> and the whole row navigates, with a hover surface to say so.
<a class="item" data-variant="outline" href="#link"> <div class="item-content"> <span class="item-title">Read the changelog</span> <p class="item-description">Everything that shipped this month.</p> </div> <div class="item-actions"> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width: 1rem; height: 1rem"> <path d="M5 12h14M12 5l7 7-7 7"></path> </svg> </div></a>Set dir="rtl" on the page or on any subtree — media and actions swap ends on their own. See
the button page for a live example.
Accessibility
Section titled “Accessibility”- A list of items is a list. Wrap them in
<ul>/<li>when they are one, so the count is announced and the rows can be navigated as a group. - Titles are clamped, not shortened.
line-clamphides overflow visually while the full text stays in the accessibility tree, which is the right way round — but a title that always overflows is a sign the layout needs the room, not the clamp. - The media is decoration unless it carries information. Give a decorative icon
aria-hidden="true", and an avatar its person’s name.