Components
Text
Typography component with text style presets and semantic HTML support
Overview
A component for rendering text. Uses text style presets from @illog/themes to provide consistent typography.
Text Styles
| Style | Size | Weight | Line Height | Use Case |
|---|---|---|---|---|
title | 48px | bold | 1.2 | Page title |
subtitle | 32px | semiBold | 1.2 | Section heading |
heading | 24px | semiBold | 1.2 | Content heading |
subheading | 20px | regular | 1.2 | Subheading |
bodyBase | 16px | regular | 1.4 | Default body text |
bodyStrong | 16px | semiBold | 1.4 | Emphasized body text |
bodySmall | 14px | regular | 1.4 | Small body text |
bodySmallStrong | 14px | semiBold | 1.4 | Small emphasized body text |
caption | 12px | regular | 1.4 | Caption, label |
captionStrong | 12px | semiBold | 1.4 | Emphasized caption |
Colors
Props
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
textStyle | 'title' | 'subtitle' | 'heading' | 'subheading' | 'bodyBase' | 'bodyStrong' | 'bodySmall' | 'bodySmallStrong' | 'caption' | 'captionStrong' | 'singleLineBodyBase' | 'singleLineCaption' | 'bodyBase' | No | Type style (size, weight, line height) |
as | ElementType | 'p' | No | Element to render |
color | TextColorToken | - | No | Text color token. Use secondary for supporting text, not tertiary |
align | CSSProperties['textAlign'] | - | No | Text alignment |
truncate | 'true' | - | No | Cuts a single line with an ellipsis |
lineClamp | '1' | '2' | '3' | - | No | Cuts after this many lines with an ellipsis |
children | ReactNode | - | No | Content |
Usage
Specification
base
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | color | $color.text.default.default |
textStyle=title
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | typography | $text.title |
textStyle=subtitle
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | typography | $text.subtitle |
textStyle=heading
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | typography | $text.heading |
textStyle=subheading
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | typography | $text.subheading |
textStyle=bodyBase
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | typography | $text.bodyBase |
textStyle=bodyStrong
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | typography | $text.bodyStrong |
textStyle=bodySmall
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | typography | $text.bodySmall |
textStyle=bodySmallStrong
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | typography | $text.bodySmallStrong |
textStyle=caption
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | typography | $text.caption |
textStyle=captionStrong
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | typography | $text.captionStrong |
textStyle=singleLineBodyBase
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | typography | $text.singleLine.bodyBase |
textStyle=singleLineCaption
| 상태 | 요소 | 속성 | 값 |
|---|---|---|---|
| enabled | root | typography | $text.singleLine.caption |