Skip to content
nexubDesign System
v11.9.0

Components · Typography

Truncate

AlphaAdded v10.7.0

Text clipped to one or more lines, with the full text in a tooltip only while it is clipped.

import { Truncate } from '@nexub/react';
View as Markdown

Playground

Props

Quarterly infrastructure invoice for the Singapore and Frankfurt regions
TSX
<Truncate>Quarterly infrastructure invoice for the Singapore and Frankfurt regions</Truncate>

Examples

Default

Quarterly infrastructure invoice for the Singapore and Frankfurt regionsShort text

Several lines

Quarterly infrastructure invoice for the Singapore and Frankfurt regions, including premium support, data transfer and reserved capacity.

Props

Props
PropTypeDefaultDescription
linesnumber1Lines shown before the text is clipped.
asReact.ElementType<any, keyof React.JSX.IntrinsicElements>'span'The element to render.
tooltipbooleantrueShow the full text in a tooltip while it is clipped. Needs string children.

Accessibility

Notes

  • Clipped text is a tab stop, so keyboard users can read the tooltip. Text that fits adds no tab stop and no tooltip.

  • The tooltip needs string children; other children are clipped only.

On iOS & Android