Lists
ItemGroup
A list of Item rows, with an optional label that names it, lines between the rows, and what to show when it is empty. It wraps each Item in an <li>, so screen readers count the rows.
In Spoonjoy
Spoonjoy, a recipe app, is built with Ouro HX (how).
See it live, no sign-in needed: A recipe · Search
In its source: app/routes/my-recipes.tsx · app/components/recipe/SpoonsStrip.tsx · app/components/users/FellowChefList.tsx
Install
Once per app, with Tailwind CSS v4 and an @/* path alias (Ouro HX is built on Base UI, so --base base; skip -t in an existing app):
npx shadcn@latest init --base base --preset nova --yes --no-monoreponpx shadcn@latest add ourostack/ouro-ui/ouro-base#v1.2.13Then the component. From v0.8.0 it installs only the helpers it imports and never touches your stylesheet (Installing):
npx shadcn@latest add ourostack/ouro-ui/item-group#v1.2.13Or, with the @ouro namespace set up:
npx shadcn@latest add @ouro/ouro-base @ouro/item-groupIts tests, stories and Playwright spec are optional. They need Vitest 4.1.11 or later, and from v0.8.0 never change a version your app has (Testing):
npx shadcn@latest add ourostack/ouro-ui/item-group#v1.2.13 ourostack/ouro-ui/item-group-tests#v1.2.13import { ItemGroup } from "@/components/ouro/item/item-group";Paths use shadcn's default @/ alias; the CLI rewrites them to yours.
Example
<ItemGroup label="Bearer credentials" empty="No active bearer credentials.">
{credentials.map((credential) => (
<Item key={credential.id} title={credential.name} description={credential.scopes} actions={<Button>Revoke</Button>} />
))}
</ItemGroup>Use instead when
- Use
Stackinstead to space out content that is not a list of rows, and a grid ofCards for larger tiles.
Props
Type: ItemGroupProps.
children- Type:
ReactNode - The rows:
Items. Each one becomes a list item. className- Type:
string - Layout only: margins, width, grid placement (
mt-4). Appearance classes warn in development; usevariant. empty- Type:
ReactNode - What to show in place of the list when there are no rows: a sentence, or an
Empty. label- Type:
string - A short label above the list that also names it for screen readers: "Bearer credentials". Without one, name the list with
aria-label. ordered- Type:
boolean - Renders an ordered list (
<ol>), for rows whose order means something, such as steps. ref- Type:
Ref<HTMLDivElement> - Reaches the rendered element.
variant- Type:
"outline" | "plain" | "divided" - Default:
"divided" divideddraws a line between rows;outlineframes them in a bordered surface and pads them, as in a settings screen;plainhas neither.
Native attributes
Also accepts the attributes in React's HTMLAttributes (id, aria-*, event handlers), passed to the rendered element, except those named on this page.
Don't use
These are not props. Passing one fails the type check with the fix in the error, and in development a console message names the fix.
divided: Not a prop. Lines between rows are the default,variant="divided".items: Not a prop. ItemGroup takes Items as children:{rows.map((row) => <Item key={row.id} title={row.name} />)}.title: Not a prop. Ouro UI useslabel:<ItemGroup label="Bearer credentials">.
className is for layout only
Pass margins, width and grid placement (mt-4, w-full, col-span-2). Your classes always win over Ouro UI's: ItemGroup merges className last with cn (tailwind-merge), so a class that conflicts with its own replaces it.layout-classes
Appearance comes from props, not classes. In development, a class that sets appearance logs one warning per component instance, naming the prop to use instead. A class sets appearance when, after its variants (hover:, sm:) and any ! are removed, it starts with bg-, text-, border-, rounded-, shadow-, font-, ring-, from-, via-, to-, fill- or stroke-, or is border, rounded, shadow or ring, or has a dark: variant. Text wrapping, overflow and table layout classes (text-wrap, text-ellipsis, border-collapse) are layout and do not warn.
Alignment classes (text-center) warn too: set alignment on a parent element.
Claim sources
- layout-classes: test:registry/ouro/components/ouro/item/item-group.test.tsx::ItemGroup > passes attributes and a ref to the wrapper, and lets layout classes win
verify:testExists(registry/ouro/components/ouro/item/item-group.test.tsx::ItemGroup > passes attributes and a ref to the wrapper, and lets layout classes win)