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

Heading (24px)

Subheading (20px)

Body Base (16px)

Body Strong (16px)

Body Small (14px)

Caption (12px)

StyleSizeWeightLine HeightUse Case
title48pxbold1.2Page title
subtitle32pxsemiBold1.2Section heading
heading24pxsemiBold1.2Content heading
subheading20pxregular1.2Subheading
bodyBase16pxregular1.4Default body text
bodyStrong16pxsemiBold1.4Emphasized body text
bodySmall14pxregular1.4Small body text
bodySmallStrong14pxsemiBold1.4Small emphasized body text
caption12pxregular1.4Caption, label
captionStrong12pxsemiBold1.4Emphasized caption

Colors

<Text color="textDefaultDefault">Default</Text>
<Text color="textDefaultTertiary">Secondary</Text>
<Text color="textBrandDefault">Brand</Text>
<Text color="textDangerDefault">Danger</Text>
<Text color="textDefaultDisabled">Disabled</Text>

Props

PropTypeDefaultDescription
asElementType'p'HTML element
textStylestring'bodyBase'Text style preset
colorstring'textDefaultDefault'Text color token
align'left' | 'center' | 'right'Text alignment
truncate'true'Single-line truncation
lineClamp'1' | '2' | '3'Multi-line truncation
childrenReactNodeText content

Usage

import { Text } from '@illog/ui'
 
// Semantic HTML
<Text as="h1" textStyle="title">Page Title</Text>
<Text as="span" textStyle="caption" color="textDefaultDisabled">Secondary text</Text>
 
// Truncation
<Text truncate="true">Very long text will be truncated...</Text>
<Text lineClamp="2">Multi-line text will display up to 2 lines...</Text>