@biem/ui

Item

A row that shows users one entry with its media, its text and its actions.

An item lays out one entry in a row: media at the start, a title with a description in the middle, and actions at the end. Items of the same kind stack in a group, so users can scan a list and act on a single entry.

Transfer 4821

12 cases from the warehouse to the store

Usage

item-default.tsx
import {
	Item,
	ItemContent,
	ItemDescription,
	ItemTitle,
} from "@biem/ui/components/ui/item";

export function ItemDefault() {
	return (
		<div className="w-full max-w-sm">
			<Item>
				<ItemContent>
					<ItemTitle>Transfer 4821</ItemTitle>
					<ItemDescription>12 cases from the warehouse to the store</ItemDescription>
				</ItemContent>
			</Item>
		</div>
	);
}

Examples

Outline

On a busy page, a single entry needs a clear edge to read as one unit, such as a notice between a chart and a table. With variant set to "outline", the item draws that edge, so users see at once where the entry begins and ends.

Price update

New prices for 38 items apply from Monday.

Muted

Supporting information should stay present without competing with the entries users act on, such as the opening hours of a store. Set to "muted", variant sets the item apart from the page through a calm surface instead of a border, so users read it as context rather than as a task.

Delivery window

The store accepts deliveries from 6:00 to 8:00.

Extra Small

Menus and narrow panels hold many entries in little room. There, size set to "xs" shrinks the spacing of the item and the text of its description, so users scan a long list with little scrolling.

Bottle of sparkling water
Sparkling water 1.5 l

12 cases arrive on Tuesday

Small

Side panels and longer lists show many entries at once, while each entry should still be easy to read. An item with size set to "sm" shows a smaller image in its media, and a group of such items moves them closer together, so more entries fit into view while the text keeps its size.

Bottle of sparkling water
Sparkling water 1.5 l

12 cases arrive on Tuesday

Default Size

Most lists in the body of a page, such as the open orders of a store, need no density of their own. Without another value, size stays at "default", which gives media and text their full room and keeps lists at the same scale across every product.

Bottle of sparkling water
Sparkling water 1.5 l

12 cases arrive on Tuesday

Default Media

Some media already brings a size of its own, such as another component of the system. With variant left at "default", ItemMedia keeps that size and adds no background of its own, so the media appears exactly as users know it from elsewhere in the product.

L
Lorena

Counts the stock in aisle 4 on Monday

Icon Media

An icon tells users the kind of an entry before they read it, for example whether it concerns stock, a price or a task. Set to "icon", variant gives every icon in ItemMedia the same size, unless an icon sets a size of its own, so no icon in a list draws more attention than another.

Delivery received

The store checked in all 12 cases.

Image Media

Products are often recognized faster by their picture than by their name. For such media, variant set to "image" crops every picture to fill the same frame, whatever its proportions, and the frame follows the size of the item, so users compare products at a glance.

Bottle of apple juice
Apple juice 1 l

4 cases left in the store

With Actions

Many entries call for a next step, such as approving a transfer or correcting a count. Placed in ItemActions, these actions stay with the entry they belong to, so users act on it right where they read it.

Low stock

4 cases left in the store

With Header

Context that applies to the whole entry, such as the store it belongs to or the supplier who sent it, helps users place the entry before they read it. Inside ItemHeader, that context comes ahead of the media, the content and the actions, so it frames everything that follows.

Transfer 4821In transit
12 cases of apple juice

From the warehouse to the store

Details that complete an entry rarely need to be read first, such as the person responsible or the time of the last change. Gathered in ItemFooter, they follow the media, the content and the actions, so the title and the description keep the attention of users.

Inventory count

Count the stock in aisle 4 before the store opens.

214 itemsDue on Monday

Group

Entries of the same kind belong together, such as the tasks of a shift or the suppliers of a store. Wrapped in ItemGroup, they form one list for users and for assistive technology alike. With size set to "sm" or "xs" on its items, the group also moves them closer together to match their density.

Transfer 4821

12 cases from the warehouse to the store

Transfer 4822

8 cases from the store to the warehouse

Transfer 4823

20 cases from the warehouse to the store

Group with Separator

In a long list, items without a border of their own can run into each other. Between two items, ItemSeparator marks where one entry ends and the next begins, for the eye as well as for screen readers, so users keep their place while they scan.

Delivery 4812

12 cases, received on Tuesday

Delivery 4813

8 cases, expected on Thursday

Delivery 4814

20 cases, expected on Friday

Often an entry leads to a page of its own, such as the details of an order. Through render, the item becomes a real link, so the whole entry turns into one target and users can open the page in a new tab or share its address.

API Reference

Item

Propvariant
Type"default" | "outline" | "muted"
Default"default"
DescriptionControls the surface of the item. With "default", the item has no visible border and no background. With "outline", it draws a border. With "muted", it fills its area with the muted background.
Propsize
Type"default" | "sm" | "xs"
Default"default"
DescriptionControls the density of the item. With "sm", an image in ItemMedia shrinks, and an ItemGroup moves its items closer together. With "xs", the padding and the gaps of the item shrink as well, and the description uses a smaller font size.
Proprender
TypeReactElement | render function
Default–
DescriptionReplaces the native element or composes the item with another component, such as a link.

ItemMedia

Propvariant
Type"default" | "icon" | "image"
Default"default"
DescriptionControls how the media is presented. With "default", the media keeps its own size on a transparent background. With "icon", the media sets the size of an icon inside it, unless the icon carries a size class of its own. With "image", the media becomes a rounded square that follows the size of the item and crops the image to fill it.

ItemContent

ItemContent stacks the title and the description and takes the free width of the item. It renders a div and has no props of its own.

ItemTitle

ItemTitle names the entry. It renders a div and has no props of its own.

ItemDescription

ItemDescription adds supporting text below the title and cuts it off after two lines. It renders a p and has no props of its own.

ItemActions

ItemActions holds the actions of the item in a row. It renders a div and has no props of its own.

ItemHeader

ItemHeader holds a row that spans the full width of the item above the media, the content and the actions. It renders a div and has no props of its own.

ItemFooter

ItemFooter holds a row that spans the full width of the item below the media, the content and the actions. It renders a div and has no props of its own.

ItemGroup

ItemGroup stacks items in a column and marks the group as a list for assistive technology. It renders a div and has no props of its own.

ItemSeparator

Proporientation
Type"horizontal" | "vertical"
Default"horizontal"
DescriptionSets the direction of the line. Horizontal divides the items that an ItemGroup stacks.
Proprender
TypeReactElement | render function
Default–
DescriptionReplaces the native element or composes the separator with another component.