List
Semantic ordered, unordered, and description lists with token-driven spacing, marker style, and marker colour.
Renders native <ul>, <ol>, or <dl> with their matching item elements so assistive tech announces list length, position, and term/details pairings.
import { List, ListItem } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<List>
<ListItem>One</ListItem>
<ListItem>Two</ListItem>
<ListItem>Three</ListItem>
</List>
);
}
Ordered
Section titled “Ordered”OrderedList renders a <ol> and defaults to a decimal marker. It accepts the native start, reversed, and type props so numbered procedures stay flexible.
import { ListItem, OrderedList } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<OrderedList>
<ListItem>Install the package</ListItem>
<ListItem>Wrap your app in the provider</ListItem>
<ListItem>Import and render a component</ListItem>
</OrderedList>
);
}
Markers
Section titled “Markers”marker accepts disc, circle, square, none for unordered lists and decimal, lower-alpha, upper-alpha for ordered lists. Use markerColor to tint the bullet from any colour token.
import { List, ListItem, OrderedList } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<div
style={{ display: 'grid', gap: '1.5rem', gridTemplateColumns: 'repeat(2, minmax(0, 1fr))' }}
>
<List marker="disc">
<ListItem>Disc</ListItem>
<ListItem>Marker</ListItem>
</List>
<List marker="circle">
<ListItem>Circle</ListItem>
<ListItem>Marker</ListItem>
</List>
<List marker="square">
<ListItem>Square</ListItem>
<ListItem>Marker</ListItem>
</List>
<List marker="none">
<ListItem>No marker</ListItem>
<ListItem>Still a list</ListItem>
</List>
<OrderedList marker="lower-alpha">
<ListItem>Lower alpha</ListItem>
<ListItem>Marker</ListItem>
</OrderedList>
<OrderedList marker="upper-alpha">
<ListItem>Upper alpha</ListItem>
<ListItem>Marker</ListItem>
</OrderedList>
</div>
);
}
Spacing
Section titled “Spacing”spacing accepts any space token and controls the gap between items. The default is 2 — bump it up for breathing room in long lists.
import { List, ListItem } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<div
style={{ display: 'grid', gap: '1.5rem', gridTemplateColumns: 'repeat(3, minmax(0, 1fr))' }}
>
<List spacing="1">
<ListItem>Tight</ListItem>
<ListItem>Spacing</ListItem>
<ListItem>One</ListItem>
</List>
<List spacing="3">
<ListItem>Default</ListItem>
<ListItem>ish</ListItem>
<ListItem>Spacing</ListItem>
</List>
<List spacing="6">
<ListItem>Loose</ListItem>
<ListItem>Breathing</ListItem>
<ListItem>Room</ListItem>
</List>
</div>
);
}
Nested
Section titled “Nested”Nest a List (or OrderedList) inside a ListItem to express sub-points; spacing and markers can differ per level.
import { List, ListItem } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<List>
<ListItem>Typography</ListItem>
<ListItem>
Layout
<List marker="circle">
<ListItem>Box</ListItem>
<ListItem>Stack</ListItem>
<ListItem>Grid</ListItem>
</List>
</ListItem>
<ListItem>Forms</ListItem>
</List>
);
}
Description list
Section titled “Description list”DescriptionList pairs DescriptionTerm with DescriptionDetails for key-value content such as glossaries and metadata tables.
import { DescriptionDetails, DescriptionList, DescriptionTerm } from '@arshad-shah/cynosure-react';
export default function Example() {
return (
<DescriptionList>
<DescriptionTerm>Framework</DescriptionTerm>
<DescriptionDetails>React 18+</DescriptionDetails>
<DescriptionTerm>Styling</DescriptionTerm>
<DescriptionDetails>vanilla-extract with design tokens</DescriptionDetails>
<DescriptionTerm>Bundling</DescriptionTerm>
<DescriptionDetails>Tree-shakeable ESM</DescriptionDetails>
</DescriptionList>
);
}
Accessibility
Section titled “Accessibility”Listalways renders as<ul>andOrderedListas<ol>so screen readers announce the list length and item position;DescriptionListrenders<dl>to communicate term/details pairings.- Use
OrderedListwhenever sequence matters — assistive tech announces position information that an unordered list does not. - Avoid mixing non-
ListItemchildren insideList/OrderedList; the semantic structure relies on<li>children to stay intact. - Setting
marker="none"hides the visual bullet but preserves list semantics, so an unordered visual layout still reads as a list to screen readers. - Don’t pass
asto list components — they are bound to their semantic element and warn in development if you try.
Recipes
Section titled “Recipes”- Use
OrderedListfor procedural content like setup steps and checklists. - For key-value pairs, reach for
DescriptionListwithDescriptionTermandDescriptionDetailsrather than a two-column table. - Keep
ListItemcontent concise; nest aListinside aListItemwhen sub-points are needed. - Set
markerColorto an accent token to tint bullets without changing the body colour.