Skip to content
Cynosurev0.5.0
SearchStorybookGitHubnpmColour mode: System. Switch to Light

Components / Feedback and display

DescriptionList

Shows term and detail pairs, such as the facts about a record or a summary of settings. Terms sit beside their details when there is room and above them when the list is narrow.

Terms and details

When to useLink to "When to use"

  • Read-only facts with labels: a profile, an order, a file's metadata, a review step before submitting.

Use something else when:

  • the values can be edited in place: form fields (TextField, Field)
  • there are many records with the same fields: a table

UsageLink to "Usage"

tsx
Copy
import { DescriptionList } from "@arshad-shah/cynosure";

<DescriptionList
  items={[
    { term: "Name", detail: user.name },
    { term: "Teams", detail: user.teams },
  ]}
/>

A detail can be any content, or an array for a term with several values. Give each item an id when its term is not a string.

Divided

LayoutLink to "Layout"

With layout="auto" (the default) terms sit beside their details while the list is at least 28rem wide and move above them when it is narrower. It follows the list's own width, so a list in a side panel stacks even on a wide screen. Fix it with layout="inline" or layout="stacked".

Layout can be fixed

Inline terms share one column that grows to the widest term, up to 40% of the list; longer terms wrap.

Long terms wrap within their column

PropsLink to "Props"

Every prop of DescriptionList
PropWhat it doesTypeDefault
itemsRequired
The terms and their details, in order.DescriptionItem[]
layout
inline: terms beside their details. stacked: terms above. auto (default): inline when the list is at least 28rem wide, stacked when narrower (it follows the list's own width, not the window's)."auto" | "inline" | "stacked"
divided
Lines between rows.boolean
size
Text size. Default "md".Size"md"
className
Added to the root element, for layout.string
style
Layout only. Restyle through --cy-description-list-* tokens.CSSProperties

Generated from the type definitions in @arshad-shah/cynosure 0.5.0.

Behaviour and accessibilityLink to "Behaviour and accessibility"

  • Semantics: a native <dl> with <dt> terms and <dd> details, grouped per row.
  • Contrast: terms use the muted colour and details the ink colour, both at least 4.5:1 in light and dark modes.
  • Direction: the term column is on the right in right-to-left text.
  • Touch and keyboard: nothing to press; links or buttons inside details behave as usual.

ThemingLink to "Theming"

Tokens: --cy-description-list-term-width, --cy-description-list-column-gap and --cy-description-list-row-gap.

ts
Copy
createTheme({ components: { descriptionList: { termWidth: "12rem" } } });

Card · Badge · Grid

These examples run Cynosure 0.5.0 (commit 50ce30b), the version on npm.

Getting started
Theming
Icons
Accessibility
Code editors and highlighters
Using Cynosure without React
Build-tool adapters
Components
Accordion
AppShell
AspectRatio
Breadcrumbs
Calendar
Card
Container
Disclosure
Divider
DocumentViewport
Grid
Inline
PageHeader
PanZoomCanvas
ScrollArea
SideNav
SortableList
SplitPane
Stack
StatusBar
Tabs
TitleBar
Toolbar
Tree
VirtualList
ZoomControls
Announcer
Avatar
Badge
CodeBlock
DescriptionList
EmptyState
ErrorBoundary
Field
Heading
IconTile
Image
Kbd
List
LoadingDots
Notice
ProgressBar
Prose
Skeleton
Stat
Steps
Table
Text
Button
Checkbox
Checklist
ColorField
ColorSwatches
Combobox
CompareSlider
CopyButton
DateField
FileDrop
IconButton
KeyValueEditor
Link
NumberField
Pagination
PathField
RadioGroup
SearchField
SegmentedControl
Select
SelectionFrame
SignaturePad
Slider
Switch
TagInput
TextArea
TextField
ThemeToggle
TimeField
ButtonBase
ChoiceBase
DialogBase
FileInputBase
HiddenValue
Icon
InputBase
LinkBase
LiveRegion
TextAreaBase
ChatMessage
Choice
DataGrid
DeviceFrame
HighlightedText
HotkeyField
ListRow
OptionList
OverlayFrame
QRCode
RowActions
Section
SiteFooter
SiteHeader
SkipLink
SortButton
VisuallyHidden
CommandPalette
ContextMenu
Dialog
FloatingToolbar
HoverCard
Menu
Menubar
Popover
ProgressOverlay
Sheet
Toast
Tooltip
Changelog