Skip to main content

Text

Wrapped headings, paragraphs and rich-text decorations, all typography specs driven by tokens.

Basic usage​

Basic usage

Title H1

Title H2

Title H3

Body paragraph for long-form text. Font size and line height are driven by design tokens.

Secondary description

Success state text

Warning state text

Danger state text

import { LhText } from '@lh-ui/react'

export default function Demo() {
return (
<>
<LhText level="h2">Title</LhText>
<LhText>Body paragraph</LhText>
<LhText type="secondary">Secondary description</LhText>
</>
)
}

Rich text, ellipsis & copy​

Rich text, ellipsis & copy

mark

——

const ink = 'ink'

This text can be copied with one click

A long two-line text truncated after the given number of rows, keeping the first rows fully visible.

Title

Text Props​

PropDescriptionTypeValuesDefault
levelTypographic level'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'caption'—'p'
typeSemantic color'default' | 'secondary' | 'success' | 'warning' | 'danger'—'default'
strongBoldboolean—false
italicItalicboolean—false
underlineUnderlineboolean—false
markHighlighted mark (light background)boolean—false
codeInline code styleboolean—false
ellipsisEllipsis: true for single line, number for row count (max 10)boolean | number—false
copyableCopyable (renders a copy button)boolean—false
disabledDisabled (muted color, copy blocked)boolean—false
sxsx layout propsSxProps——
Ellipsis rules

ellipsis={1} equals ellipsis (single-line class lh-text--ellipsis); multi-line ellipsis emits inline line-clamp styles (-webkit-box), with the row count clamped to [1, 10].

Copy fallback

Copy prefers navigator.clipboard and falls back to execCommand('copy') for non-HTTPS / legacy webviews; the button label switches to "Copied" for 2 seconds after success.

Styles​

import '@lh-ui/react/style/text'