DetailsRow pairs a label with a value in a description list. Add a decorative icon, multiple value items, or an action supplied by your application.
Usage
dl. Pass the label through label and its value through children. The application owns labels, localization, formatted values, and placeholders for missing values.
Alignment and wrapping
Labels and values wrap rather than truncate. Multiple value items, such as chips or tags, wrap onto additional lines. Rows align their content at the top as that content grows. The label column defaults to7rem and is capped at 40% of the row’s width to leave space for the value in narrow containers. Set the same labelWidth on sibling rows to adjust their alignment. Numbers use pixels; CSS lengths such as '8rem' are also supported.
Actions
Useaction for a control beside the value. The row does not add editing, click, or keyboard behavior. Supply a control with an accessible name and connect its handler to the application behavior.
Composition and accessibility
Each row renders adiv grouping with a dt label and a dd containing the value and optional action. The caller supplies the enclosing dl. Provide meaningful text in the label. The optional startIcon is hidden from assistive technology, and the caller controls its dimensions.
Native attributes, className, style, and ref target the outer div. When using render with a custom wrapper, preserve that div directly inside the dl and forward all supplied props and the ref. Keep actions inside their slot so the term and definition remain the row’s direct children.
Use MetricRow for a metric with optional progress. DetailsRow provides only the label, value, and action layout.
Props
ReactNode
Optional action content beside the value. The caller supplies controls, accessible names, and handlers.
ReactNode
required
Value content rendered in the description definition. Text and multiple items wrap within the available space.
string
CSS class applied to the row root.
ReactNode
required
Visible label rendered as the description term.
Width<string | number>
default:"7rem"
Preferred label column width. Numbers use pixels. The column is capped at 40% of the row width; use the same width for aligned sibling rows.
Ref<HTMLDivElement>
Ref forwarded to the row root div.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>
Customizes the row root. Preserve a div directly inside a dl and forward its props and ref to retain valid description-list grouping.
ReactNode
Decorative node before the label. The caller controls icon dimensions.
CSSProperties
Inline styles applied to the row root.