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 descriptionSuccess 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
Title
Text Props
| Prop | Description | Type | Values | Default |
|---|---|---|---|---|
| level | Typographic level | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'caption' | — | 'p' |
| type | Semantic color | 'default' | 'secondary' | 'success' | 'warning' | 'danger' | — | 'default' |
| strong | Bold | boolean | — | false |
| italic | Italic | boolean | — | false |
| underline | Underline | boolean | — | false |
| mark | Highlighted mark (light background) | boolean | — | false |
| code | Inline code style | boolean | — | false |
| ellipsis | Ellipsis: true for single line, number for row count (max 10) | boolean | number | — | false |
| copyable | Copyable (renders a copy button) | boolean | — | false |
| disabled | Disabled (muted color, copy blocked) | boolean | — | false |
| sx | sx layout props | SxProps | — | — |
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'