Skip to content

Item

A row with a picture or icon, a title, a description and actions. Use it for lists of people, files or settings. Same markup and props in every style: switch the style in the header to see it change.

Basic

An outlined item with an avatar and a button, and a muted item with an icon.

AL

Ada Lovelace

ada@example.com

Two-step sign-in

Ask for a code when you sign in on a new device.

item-basic.html
<div style="display: grid; gap: 12px; width: 100%; max-width: 420px">
  <div class="vin-item vin-item--outline">
    <div class="vin-item__media">
      <span class="vin-avatar" role="img" aria-label="Ada Lovelace">
        <img class="vin-avatar__img" src="/ui/avatars/ada.svg" alt="">
        <span class="vin-avatar__fallback">AL</span>
      </span>
    </div>
    <div class="vin-item__content">
      <p class="vin-item__title">Ada Lovelace</p>
      <p class="vin-item__description">ada@example.com</p>
    </div>
    <div class="vin-item__actions">
      <button type="button" class="vin-btn vin-btn--outline vin-btn--sm">Invite</button>
    </div>
  </div>
  <div class="vin-item vin-item--muted">
    <div class="vin-item__media"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg></div>
    <div class="vin-item__content">
      <p class="vin-item__title">Two-step sign-in</p>
      <p class="vin-item__description">Ask for a code when you sign in on a new device.</p>
    </div>
    <div class="vin-item__actions">
      <button type="button" class="vin-btn vin-btn--sm">Turn on</button>
    </div>
  </div>
</div>

Group

Items in a list with lines between them.

Brand guidelines.pdf

2.4 MB · Edited today

Shared

Hero image.png

840 KB · Edited yesterday

Draft

Release notes.md

12 KB · Edited 3 days ago

Draft
item-group.html
<div class="vin-item-group" role="list" style="max-width: 420px">
  <div class="vin-item" role="listitem">
    <div class="vin-item__media"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/><path d="M14 3v6h6"/></svg></div>
    <div class="vin-item__content">
      <p class="vin-item__title">Brand guidelines.pdf</p>
      <p class="vin-item__description">2.4 MB · Edited today</p>
    </div>
    <div class="vin-item__actions"><span class="vin-badge vin-badge--success">Shared</span></div>
  </div>
  <div class="vin-item" role="listitem">
    <div class="vin-item__media"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-5-5L5 21"/></svg></div>
    <div class="vin-item__content">
      <p class="vin-item__title">Hero image.png</p>
      <p class="vin-item__description">840 KB · Edited yesterday</p>
    </div>
    <div class="vin-item__actions"><span class="vin-badge">Draft</span></div>
  </div>
  <div class="vin-item" role="listitem">
    <div class="vin-item__media"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/><path d="M14 3v6h6"/><path d="M8 13h8M8 17h5"/></svg></div>
    <div class="vin-item__content">
      <p class="vin-item__title">Release notes.md</p>
      <p class="vin-item__description">12 KB · Edited 3 days ago</p>
    </div>
    <div class="vin-item__actions"><span class="vin-badge">Draft</span></div>
  </div>
</div>

When the whole row goes somewhere, make the item a link and end it with a chevron.

Installation

React, Vue and Svelte: add the component to your project with the CLI. It reads your framework from vin.json and also copies any component this one needs. Then import it:

Terminal
npx @vinish/ui add item
React
import { Item, ItemGroup } from "@/components/vin/item";
Vue
import Item, { ItemGroup } from "@/components/vin/item.vue";
Svelte
import Item from "$lib/components/vin/item.svelte";
import ItemGroup from "$lib/components/vin/item-group.svelte";

The import paths assume the default folders: @/components/vin (React and Vue, with the usual @ → src alias) and $lib/components/vin (SvelteKit). Use your own if you chose another folder in init. How the Vue and Svelte versions pass values and content is in Frameworks.

Plain HTML: the classes come with the style's stylesheet. It needs no JavaScript.

API

From spec/item.json, which every framework version is tested against.

PropValuesDefaultIn HTML
variantdefaultoutlinemuteddefaultvin-item--{value}
media
An icon or an Avatar.
ReactNode—.vin-item__media
titleReactNode—.vin-item__title (one line, cut with …)
descriptionReactNode—.vin-item__description
actions
Buttons, a badge or a chevron at the end.
ReactNode—.vin-item__actions
href
Makes the whole row a link.
string—<a class="vin-item" href>
ItemGroup
A bordered list of items with lines between them.
children—.vin-item-group[role=list] > .vin-item[role=listitem]

Parts

React, Vue, SvelteHTML classes
<Item><ItemGroup>.vin-item.vin-item--outline.vin-item--muted.vin-item__media.vin-item__content.vin-item__title.vin-item__description.vin-item__actions.vin-item-group

Accessibility

  • An item group is a list (role="list" and "listitem"), so screen readers say how many items there are.
  • A clickable row is one <a> or <button>; don't put other buttons inside a link item.
  • Icons and chevrons are hidden from screen readers; the title says what the row is.