Create

General

Item

Copy page View as Markdown Open in ChatGPT Open in Claude

A versatile component for displaying content with media, title, description, and actions.

Usage#

app.component.ts
import { WDS_ITEM } from '@wds/angular/item';

Examples#

Default#

With href the whole item is a link, while buttons in the actions slot work on their own.

Action

Variant#

Open Open Open

Icon#

media="icon" shows the icon on a muted 32×32 background.

Review

Avatar#

Invite

Image#

media="image" crops the image to 40×40.

3:45 4:05

Group#

wds-item-group is a list of items; wds-item-separator draws a line between them.

The header and footer slots add full-width rows above and below the item.

New September 12 Preview Download

Size#

Tile#

layout="tile" makes a square with the media centered and the title below. It combines with variant and size.

Marker#

size="xs" makes a marker: one line of small, muted text with a 16px icon column and no padding, e.g. the steps of an agent or a build. Long text wraps inside the row.

Marker with status#

Icons in the media slot show the state of each step; a wds-spinner marks the running one. The actions slot holds the duration on the right.

12s 48s

Marker with phases#

A wds-separator with text groups the markers into phases.

Plan Build Verify

Marker with borders#

In a wds-item-group with wds-item-separator lines between them, markers make a compact list, here of changed files.

+312 −0 +4 −1 +4 −0

With href the marker is a link: the text darkens and is underlined on hover.

API References#

wds-item#

List item: media, title with description and actions (e.g. a person, a file, a setting, a notification). With href the whole item is a link (stretched over the whole surface), while buttons in the actions slot work on their own.

Attributes

AttributeTypeDefaultDescription
variantWdsItemVariant'default'Style: no background, with a border (outline) or on a muted background (muted).
sizeWdsItemSize'default'sm reduces the spacing. xs is a marker: one line of small, muted text with an icon column and no padding (a status, a step in a log, a changed file).
layoutWdsItemLayout'default'tile: a square with the media centered and the title below it (e.g. an icon gallery). Combines with variant and size.
mediaWdsItemMedia'default'Media style: icon (icon on a 32×32 background) or image (40×40 image).
headingstring''Title. The title slot takes precedence.
descriptionstring''Description. The description slot takes precedence.
hrefstring | undefinedURL: the whole item becomes a link.
targetstring | undefinedLink target, e.g. _blank.
relstring | undefinedLink rel. With target="_blank" it defaults to noopener noreferrer.

Slots

SlotDescription
(default)Additional content below the description.
media<svg> icon, image or avatar.
titleTitle (instead of heading).
descriptionDescription (instead of description), clamped to 2 lines.
actionsButtons, badges, switches on the right.
headerRow above the item (full width).
footerRow below the item (full width).

CSS parts (::part)

PartDescription
itemThe container.
mediaThe media.
contentTitle, description and content.
titleThe title.
descriptionThe description.
actionsThe actions.

CSS custom properties

PropertyDescription
--wds-item-radiusBorder radius.
--wds-item-description-linesNumber of lines after which the description is clamped (default 2).

wds-item-group#

A list of wds-item elements (role="list").

Slots

SlotDescription
(default)wds-item and wds-item-separator.

CSS custom properties

PropertyDescription
--wds-item-group-gapGap between items (default 0).

wds-item-separator#

A line between items in wds-item-group (decorative).

Accessibility#

Screen reader#

wds-item-group has role="list" and each wds-item directly inside it role="listitem", so screen readers announce the number of items. wds-item-separator is hidden from screen readers.

With href the title is a native <a> stretched over the whole item: the link is named by the title, and the description is read as the next text. Without href the item has no role of its own.

The title is not a heading. Give icons aria-hidden="true", decorative images alt="", and icon-only buttons in the actions slot a label.

Keyboard support#

KeyFunction
TabMoves focus to the link of an item with href, then to the controls in the actions, header and footer slots.
EnterFollows the link or activates the focused button.
Footer