Item New Alpha Light DOM & Tailwind

Open in Storybook

A flexible, composable row used to display a piece of content such as a person, a file or a setting.

OverviewUsageCompositionExamplesAccessibilityAPI referencePartsDesign guidelines
This component is considered alpha. We're still finalising the API, so it may include a breaking change at any time — use it at your own risk.
Loading...

Usage

Item is a flexible, composable row used to display a piece of content such as a person, a file or a setting. Combine it with its parts to build rich list rows, and stack several together with Item Group.

Import the parts you need — each import registers its custom element:

Copy code
import "@nordhealth/components/lib/Item"
import "@nordhealth/components/lib/ItemActions"
import "@nordhealth/components/lib/ItemContent"
import "@nordhealth/components/lib/ItemDescription"
import "@nordhealth/components/lib/ItemFooter"
import "@nordhealth/components/lib/ItemGroup"
import "@nordhealth/components/lib/ItemHeader"
import "@nordhealth/components/lib/ItemMedia"
import "@nordhealth/components/lib/ItemSeparator"
import "@nordhealth/components/lib/ItemTitle"

Then compose the parts inside an Item:

Composition

An Item lays out a leading visual, textual content and trailing controls in a single row. The variant attribute controls its appearance (default, outline or muted) and size controls its padding and gap (xs, s or m). Wrap an Item in an <a> element to make the whole row act as a link.

Copy code
Item
├── ItemMedia        (optional, leading visual)
├── ItemContent
│   ├── ItemTitle
│   └── ItemDescription   (optional)
└── ItemActions      (optional, trailing controls)
Copy code
<nord-item variant="outline">
  <nord-item-media variant="icon">
    <!-- icon, avatar or image -->
  </nord-item-media>
  <nord-item-content>
    <nord-item-title>Title</nord-item-title>
    <nord-item-description>Secondary line of text.</nord-item-description>
  </nord-item-content>
  <nord-item-actions>
    <!-- buttons or a chevron -->
  </nord-item-actions>
</nord-item>

Item Media

Item Media holds the leading visual of an Item, such as an icon, an avatar or an image. Its variant attribute switches between default (simply centers its content), icon (a small bordered, muted square that centers an icon) and image (a rounded square that clips an image to a cover fit).

Item Content

Item Content holds the textual content of an Item, typically an Item Title and an Item Description. It grows to fill the available space.

Item Title

Item Title is the primary line of text in an Item. It can also contain an inline icon.

Item Description

Item Description is the secondary, muted line of text in an Item. It is clamped to two lines.

Item Actions

Item Actions holds the trailing controls of an Item, such as buttons or a chevron.

Item Header

Item Header spans the full width at the top of an Item, useful for a leading image or a row of metadata.

Item Footer spans the full width at the bottom of an Item, useful for a row of metadata or trailing actions.

Item Group

Item Group stacks a set of Item rows vertically and exposes them to assistive technology as a list. Separate individual items with Item Separator.

Item Separator

Item Separator draws a horizontal divider between Item rows inside an Item Group.

Examples

Variants

The variant attribute switches between a transparent default, an outline with a visible border, and a muted filled background for secondary content.

Sizes

The size attribute controls the item's padding and gap, from the standard m down to a compact xs.

Avatar media

Use Item Media for an avatar, and Item Actions for a trailing button.

Item group

Stack several Items in an Item Group, which exposes them to assistive technology as a list.

Wrap an Item in an <a> element to make the whole row act as a link. The row highlights on hover when wrapped this way.

With an icon

Place an icon in Item Media to give the row a leading glyph.

With an avatar

Combine an avatar with supporting text and trailing actions for a richer row.

With an image

Use an image in Item Media for thumbnails such as product or document previews.

Use Item Header to label a group of items.

Grouped items

Combine headers, media and actions across a full Item Group.

With a dropdown

Trigger a Dropdown from an Item's trailing actions for per-row menus.

RTL

Item follows the document or container direction. Toggle the direction to see the layout mirror.

Accessibility

  • Wrap a set of related items in an Item Group, which exposes them to assistive technology as a list so screen reader users hear the number of items and can navigate between them.
  • To make an entire Item act as a link, wrap it in an <a> element rather than nesting interactive controls — this gives a single, predictable target for keyboard and pointer users.
  • Give icon-only controls in Item Actions an accessible name with aria-label, since the icon alone has no text for assistive technology.
  • An Item Separator is purely visual — don't use it to convey grouping that isn't already expressed by the Item Group structure.

API reference

Item

Item is a flexible, composable row used to display a piece of content such as a person, a file or a setting. Combine it with Item Media, Item Content, Item Title, Item Description and Item Actions to build rich list rows. Stack several together with Item Group. To make a whole Item act as a link, wrap it in an <a> element. The row highlights on hover when wrapped this way.

<nord-item></nord-item>

Props

PropertyAttribute Description TypeDefault
variantvariantThe visual style of the item. - default has a transparent background and no border. - outline adds a visible border. - muted uses a subtle filled background for secondary content.'default' | 'outline' | 'muted''default'
sizesizeThe size of the item, controlling its padding and gap.'xs' | 's' | 'm''s'

Slots

Slot name Description
Default slotDefault slot for the item parts (media, content, actions, header, footer).

CSS Properties

CSS Custom Properties provide more fine grain control over component presentation. We advise utilizing existing properties on the component before using these.

PropertyDescriptionDefault
--n-item-gapControls the spacing between the item parts, using our spacing tokens.
--n-item-paddingControls the inner padding of the item, using our spacing tokens.
--n-item-border-radiusControls how rounded the corners are.var(--n-border-radius-s)
Light DOM & Tailwind. This component renders in the light DOM, so you can style it directly with your own CSS or Tailwind utility classes — there is no shadow boundary, and its default styles are low specificity, so your utilities win.

Parts

This component is made up of the following parts.

Item Actions

Item Actions holds the trailing controls of an Item, such as buttons or a chevron.

<nord-item-actions></nord-item-actions>

Slots

Slot name Description
Default slotDefault slot for the actions, such as buttons or an icon.

Item Content

Item Content holds the textual content of an Item, typically an Item Title and an Item Description. It grows to fill the available space.

<nord-item-content></nord-item-content>

Slots

Slot name Description
Default slotDefault slot for the content, such as a title and description.

Item Description

Item Description is the secondary, muted line of text in an Item. It is clamped to two lines.

<nord-item-description></nord-item-description>

Slots

Slot name Description
Default slotDefault slot for the description text.

Item Group

Item Group stacks a set of Item rows vertically and exposes them to assistive technology as a list. Separate individual items with Item Separator.

<nord-item-group></nord-item-group>

Slots

Slot name Description
Default slotDefault slot for Item elements.

Item Header

Item Header spans the full width at the top of an Item, useful for a leading image or a row of metadata.

<nord-item-header></nord-item-header>

Slots

Slot name Description
Default slotDefault slot for the header content.

Item Media

Item Media holds the leading visual of an Item, such as an icon, an avatar or an image.

<nord-item-media></nord-item-media>

Props

PropertyAttribute Description TypeDefault
variantvariantThe visual style of the media container. - default simply centers its content. - icon renders a small bordered, muted square that centers an icon. - image renders a rounded square that clips an image to a cover fit.'default' | 'icon' | 'image''default'

Slots

Slot name Description
Default slotDefault slot for the media content (an icon, avatar or image).

Item Separator

Item Separator draws a horizontal divider between Item rows inside an Item Group.

<nord-item-separator></nord-item-separator>

Item Title

Item Title is the primary line of text in an Item.

<nord-item-title></nord-item-title>

Slots

Slot name Description
Default slotDefault slot for the title text (and optionally an inline icon).
Design guidelinesFor designers

Usage

This section includes guidelines for designers and developers about the usage of this component in different contexts.

Item is a composable row. Combine it with its parts to build list rows:

Copy code
<nord-item variant="outline">
  <nord-item-media variant="icon">
    <nord-icon name="navigation-notifications"></nord-icon>
  </nord-item-media>
  <nord-item-content>
    <nord-item-title>Inbox</nord-item-title>
    <nord-item-description>You have 3 unread messages.</nord-item-description>
  </nord-item-content>
  <nord-item-actions>
    <nord-button size="s">View</nord-button>
  </nord-item-actions>
</nord-item>

Clickable items

To make a whole item act as a link, wrap it in an <a> element. The row highlights on hover and shows a focus ring when the link is focused.

Copy code
<a href="/profile">
  <nord-item variant="outline">
    <nord-item-content>
      <nord-item-title>Your profile</nord-item-title>
    </nord-item-content>
    <nord-item-actions>
      <nord-icon name="arrow-right-small"></nord-icon>
    </nord-item-actions>
  </nord-item>
</a>

Do

  • Use Item to present a single, self-contained piece of content such as a person, file or setting.
  • Group related items with Item Group so assistive technology announces them as a list.
  • Keep the Item Title concise and put supporting text in the Item Description.
  • Wrap an item in an <a> element when the entire row should be a link.

Don’t

  • Don’t place interactive controls inside an item that is itself wrapped in a link, as nested interactive elements are not accessible.
  • Don’t use Item for long-form content, it is intended for compact rows.
  • Don’t omit an accessible label on icon-only buttons placed in Item Actions.

Was this page helpful?

Yes No

We use this feedback to improve our documentation.