List

Lists present simple structured items with descriptions, metadata, and native links.

Overview and decision boundary

Use List to present short structured items that are not tabular data and do not need selection behavior.

Do not use List for DataGrid, command palette, sidebar navigation, or selectable listbox patterns.

Preview

import * as React from 'react';import { List } from '@nerio-ui/ui';const AppLink = React.forwardRef<HTMLAnchorElement, React.AnchorHTMLAttributes<HTMLAnchorElement>>(function AppLink(props, ref) {  return <a ref={ref} data-router-link="" {...props} />;});<List items={[{ id: 'tokens', title: 'Tokens', description: 'CSS variable foundation for themes, modes, and density.', href: '/docs/foundations/tokens', render: <AppLink href="#" /> }, { id: 'components', title: 'Components', description: 'Composable Core primitives installed as source.', href: '/docs/components/button' }]} />

Installation and imports

Install the editable registry source, or use the matching package entrypoint when the product keeps Nerio as a workspace dependency.

pnpm dlx nerio add listimport * as React from 'react';import { List } from '@nerio-ui/ui';

Usage

import * as React from 'react';import { List } from '@nerio-ui/ui';const AppLink = React.forwardRef<HTMLAnchorElement, React.AnchorHTMLAttributes<HTMLAnchorElement>>(function AppLink(props, ref) {  return <a ref={ref} data-router-link="" {...props} />;});<List items={[{ id: 'tokens', title: 'Tokens', description: 'CSS variable foundation for themes, modes, and density.', href: '/docs/foundations/tokens', render: <AppLink href="#" /> }, { id: 'components', title: 'Components', description: 'Composable Core primitives installed as source.', href: '/docs/components/button' }]} />

Variants

VariantPurpose
unorderedUnordered is part of the public component contract.
orderedOrdered is part of the public component contract.

Anatomy

SlotPurpose
rootSemantic ul by default or ol when ordered is true.
itemOne structured list item.
bodyBody slot exposed through data-slot="body".
linkNative anchor wrapper when an item has href.
leadingLeading slot exposed through data-slot="leading".
contentContent slot exposed through data-slot="content".
titlePrimary item label.
descriptionOptional supporting item copy.
trailingTrailing slot exposed through data-slot="trailing".
metaOptional compact metadata in the trailing slot.

States

StatePurpose
StaticItems without href render as non-interactive content.
LinkedItems with href render native anchors.
FocusLinked items use the shared Nerio focus ring.

Motion

  • hover
  • focus

Accessibility

  • Uses semantic ul by default and semantic ol when ordered is true.
  • Items with href render native anchors instead of fake interactive containers.
  • Optional description and metadata remain in the natural reading order.
  • linkProps can extend class, events, target, rel, aria, and data attributes; item.href and the internal data-slot remain protected.
  • Use render for a custom router link element; List forwards the canonical href, merged class, accessible props, and link data-slot without depending on a router package.
  • Do not use List for selectable listbox, command menu, or data table behavior.

API

PropPurpose
itemsArray of title, description, meta, href, leading, and trailing values.
orderedRenders an ol when sequence matters; otherwise renders a ul.
linkPropsExtends link behavior but cannot replace the canonical item.href or internal link anatomy.
renderOptional router link element that receives the canonical href, class, accessible props, and link data-slot.
classNameExtends the list root without replacing tokenized defaults.

Implementation contract

ContractValue
Registry itemlist installs 6 source files into the configured components directory.
Base UINo interactive primitive required.
Registry dependenciesNone.
Package dependenciesclsx, react, tailwind-merge, tailwindcss

Styling contract

ContractValue
AuthoringComplete, statically detectable Tailwind CSS v4 recipes own component visuals.
ValuesSemantic and component --n-* variables remain the canonical customization layer.
OverridesCustomizable slots merge consumer className values with tailwindCn so conflicting utilities resolve deterministically.
Residual CSSOnly shared keyframes and scoped no-Preflight compatibility rules remain; there is no parallel visual selector layer.

Design notes

  • Use List to present short structured items that are not tabular data and do not need selection behavior.

Do / do not

Do

Use for docs links, settings summaries, compact resources, and simple object lists.

Do not

Do not use List for DataGrid, command palette, sidebar navigation, or selectable listbox patterns.

Tokens

These are the primary customization points. Override semantic or component tokens instead of changing component source.

TokenPurpose
--n-list-gapPublic customization point for this component contract.
--n-list-item-paddingPublic customization point for this component contract.
--n-list-item-gapPublic customization point for this component contract.
--n-list-item-radiusPublic customization point for this component contract.
--n-list-item-backgroundPublic customization point for this component contract.
--n-list-item-background-hoverPublic customization point for this component contract.
--n-list-item-borderPublic customization point for this component contract.
--n-list-item-border-hoverPublic customization point for this component contract.
--n-focus-ringPublic customization point for this component contract.