Skip to main content

Text

Typography component for headings and body text.

Import​

import '@kittl/ui';
import { Text } from '@kittl/ui-react';

Usage​

<kittl-text variant="h2">Heading</kittl-text>
<kittl-text variant="p1">Body paragraph text.</kittl-text>
<kittl-text variant="p3" color="secondary">Small secondary text.</kittl-text>
<kittl-text variant="p1" truncate
>This long text will be truncated with an ellipsis.</kittl-text
>
import { Text } from '@kittl/ui-react';

/** Basic Text usage, rendered live on the docs site. */
export const TextUsage = () => (
<>
<Text variant="h2">Heading</Text>
<Text variant="p1">Body paragraph text.</Text>
<Text variant="p3" color="secondary">
Small secondary text.
</Text>
<Text variant="p1" truncate>
This long text will be truncated with an ellipsis.
</Text>
</>
);

Props​

PropertyAttributeTypeDefaultDescription
variantvariant'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p0' | 'p1' | 'p2' | 'p3' | 'p4''p1'Typography variant
colorcolor'default' | 'secondary' | 'tertiary' | 'disabled' | 'critical' | 'info' | 'brand-on-bg' | 'theme-agnostic-white' | 'inherit''default'Text color
textAligntextAlign'left' | 'center' | 'right'—Horizontal alignment; inherits from the parent when unset
truncatetruncatebooleanfalseTruncate with ellipsis on overflow

Variant Guide​

VariantUse case
h1–h6Headings (largest to smallest)
p0Large body text
p1Default body text
p2Small body text
p3Caption text
p4Smallest text