Detail Text
The Detail Text component displays small, muted text for supplementary information and metadata. Use Detail Text to show timestamps, captions, or other secondary information.Installation
Usage
Props
DetailText Props
| Prop | Type | Default | Description |
|---|---|---|---|
element | string | 'DETAIL_TEXT' | Overrides the default element name to apply unique styles with the Customization Provider. |
as | BoxProps['as'] | 'div' | The HTML tag to render the Detail Text as. |
marginTop | 'space0' | 'space30' | 'space30' | The marginTop of the DetailText. Currently we only allow space0 to remove top margin. |
Styling Details
The Detail Text component has the following default styles:color:colorTextWeakfontSize:fontSize20lineHeight:lineHeight20fontWeight:fontWeightMediummarginTop:space30(can be overridden tospace0)
Examples
Default Detail Text
Without Top Margin
UsemarginTop="space0" to remove the default top margin:
Custom HTML Element
Customization
The Detail Text component can be customized using the Customization Provider:Use Cases
- Timestamps below content
- Image captions
- Metadata labels
- Supplementary information
- Helper text
- File sizes or dates
Accessibility
- The muted color (
colorTextWeak) still maintains accessible contrast ratios - Consider the semantic meaning when choosing the
asprop value - Don’t use Detail Text for critical information that needs to stand out