The example below loads live from Storybook; open it in Storybook to use the controls.
Sizes and weight
Section titled “Sizes and weight”sm gives 12 px, md 14 px and lg 16 px. weight="medium" uses the label style of the same size. lg has the regular weight only; there is no 16 px label token.
import { Text } from '@bigbang/ui';
export default function Sizes() { return ( <div className="flex flex-col gap-sm"> <Text size="lg">lg, 16 px: sample text</Text> <Text size="md">md, 14 px: sample text</Text> <Text size="sm">sm, 12 px: sample text</Text> <Text size="md" weight="medium">md, medium weight: sample text</Text> <Text size="sm" weight="medium">sm, medium weight: sample text</Text> </div> );}Tone changes the colour only. Status tones (danger, success, warning, info) do not carry meaning alone; the text or an icon says it too.
import { Text } from '@bigbang/ui';
const tones = ['default', 'subtle', 'subtlest', 'danger', 'success', 'warning', 'info'] as const;
export default function Tones() { return ( <div className="flex flex-col gap-xs"> {tones.map((tone) => ( <Text key={tone} tone={tone}> {tone}: sample text </Text> ))} </div> );}On a dark surface
Section titled “On a dark surface”The inverse tone is for text on a dark surface (surface-inverse).
import { Text } from '@bigbang/ui';
export default function Inverse() { return ( <div className="bg-surface-inverse px-lg py-md"> <Text tone="inverse">Sample text on a dark surface</Text> </div> );}Truncation
Section titled “Truncation”truncate cuts the text with an ellipsis after one line (true) or after the given number of lines (2-6). Give the full text another way; the example uses title.
import { Text } from '@bigbang/ui';
const long = 'This text is only a sample and is long enough not to fit the box; the cut part stays in the title attribute.';
export default function Truncate() { return ( <div className="flex w-64 flex-col gap-md"> <Text truncate title={long}> {long} </Text> <Text truncate={2} title={long}> {long} </Text> </div> );}Tabular figures
Section titled “Tabular figures”numeric draws digits at equal width; they line up in columns and do not shift while a value changes.
import { Text } from '@bigbang/ui';
export default function Numeric() { return ( <div className="flex gap-3xl"> <div className="flex flex-col gap-xs"> <Text size="sm" tone="subtle">Without numeric</Text> <Text>11:11</Text> <Text>88:88</Text> </div> <div className="flex flex-col gap-xs"> <Text size="sm" tone="subtle">numeric</Text> <Text numeric>11:11</Text> <Text numeric>88:88</Text> </div> </div> );}As an element
Section titled “As an element”The default element is a <span>. Use render to draw <p>, <strong>, <label> or <time>.
Paragraph: sample text
Emphasis: sample textimport { Text } from '@bigbang/ui';
export default function AsElement() { return ( <div className="flex flex-col gap-sm"> <Text render={<p />}>Paragraph: sample text</Text> <Text render={<strong />} weight="medium">Emphasis: sample text</Text> <Text render={<time dateTime="2026-10-28" />} tone="subtle">28 October 2026</Text> </div> );}Light and dark mode
Section titled “Light and dark mode”Colours come from text tokens; light and dark mode need no separate setting.
import { Text } from '@bigbang/ui';
const tones = ['default', 'subtle', 'subtlest', 'danger', 'success', 'warning', 'info'] as const;
export default function Tones() { return ( <div className="flex flex-col gap-xs"> {tones.map((tone) => ( <Text key={tone} tone={tone}> {tone}: sample text </Text> ))} </div> );}