Truncate

Use Truncate to shorten overflowing text with an ellipsis.

  • @primer/react@37.2.0
  • Alpha
  • Not reviewed for accessibility

Import

import {Truncate} from '@primer/react'

Examples

View in Storybook

Props

Truncate

NameDefaultDescription
maxWidth
125number

Sets the max-width of the text.

inline
falseboolean

Displays text as inline block and vertical aligns to the top.

expandable
falseboolean

Allows the truncated text to be displayed on hover.

as
'div'React.ElementType
sx
SystemStyleObject
Navigated to Truncate