Text
The prose primitive — size, weight, color and rhythm as typed tokens, all responsive.
Typography that stays on scale
Text is the prose primitive — size, weight, color and spacing come from the token scale, and every prop takes a responsive map.
Last updated three minutes ago
import { Text, VStack } from "astralis-ui";
export function TextDemo() {
return (
<VStack gap="1" maxW="md">
<Text size="lg" weight="semibold">
Typography that stays on scale
</Text>
<Text color="muted">
Text is the prose primitive — size, weight, color and spacing come
from the token scale, and every prop takes a responsive map.
</Text>
<Text size="sm" color="subtle" fontStyle="italic">
Last updated three minutes ago
</Text>
</VStack>
);
}Import#
import { Text } from "astralis-ui";Sizes#
Thirteen steps from xs to 9xl; the first eight cover almost all prose.
The quick brown fox (xs)
The quick brown fox (sm)
The quick brown fox (md)
The quick brown fox (lg)
The quick brown fox (xl)
The quick brown fox (2xl)
The quick brown fox (3xl)
The quick brown fox (4xl)
import { Text, VStack } from "astralis-ui";
const sizes = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl"] as const;
export function TextSizes() {
return (
<VStack gap="2" alignItems="start">
{sizes.map((size) => (
<Text key={size} size={size}>
The quick brown fox ({size})
</Text>
))}
</VStack>
);
}Weights#
Weight light
Weight normal
Weight medium
Weight semibold
Weight bold
Weight extrabold
import { Text, VStack } from "astralis-ui";
const weights = ["light", "normal", "medium", "semibold", "bold", "extrabold"] as const;
export function TextWeights() {
return (
<VStack gap="1" alignItems="start">
{weights.map((weight) => (
<Text key={weight} weight={weight}>
Weight {weight}
</Text>
))}
</VStack>
);
}Truncation#
truncate for one-line ellipsis, lineClamp for multi-line — no CSS needed
on your side.
truncate — one line, ellipsis
Space is big. You just won't believe how vastly, hugely, mind-bogglingly big it is. You may think it's a long way down the road to the chemist's, but that's just peanuts to space.
lineClamp="3"
Space is big. You just won't believe how vastly, hugely, mind-bogglingly big it is. You may think it's a long way down the road to the chemist's, but that's just peanuts to space.
import { Text, VStack, Box } from "astralis-ui";
const long =
"Space is big. You just won't believe how vastly, hugely, mind-bogglingly big it is. You may think it's a long way down the road to the chemist's, but that's just peanuts to space.";
export function TextTruncation() {
return (
<VStack gap="4" alignItems="stretch" w="full" maxW="xs">
<Box>
<Text size="xs" color="subtle" gutterBottom>truncate — one line, ellipsis</Text>
<Text size="sm" truncate>{long}</Text>
</Box>
<Box>
<Text size="xs" color="subtle" gutterBottom>lineClamp="3"</Text>
<Text size="sm" lineClamp="3">{long}</Text>
</Box>
</VStack>
);
}Styling#
Casing, tracking, decoration, family and the status colors compose freely.
Overline label
Underlined for emphasis
Crossed off the list
fontFamily="mono" without reaching for Code
Status colors come from the same token map
import { Text, VStack } from "astralis-ui";
export function TextStyling() {
return (
<VStack gap="2" alignItems="start">
<Text casing="uppercase" letterSpacing="widest" size="xs" weight="medium" color="muted">
Overline label
</Text>
<Text textDecoration="underline">Underlined for emphasis</Text>
<Text textDecoration="line-through" color="subtle">
Crossed off the list
</Text>
<Text fontFamily="mono" size="sm">
fontFamily="mono" without reaching for Code
</Text>
<Text color="success" weight="medium">
Status colors come from the same token map
</Text>
</VStack>
);
}Responsive#
Every prop on this page accepts a breakpoint map:
<Text size={{ base: "sm", md: "md", lg: "lg" }} align={{ base: "center", md: "left" }}>
Scales with the viewport
</Text>Props#
Text renders a p by default and forwards all standard HTML props.
| Prop | Type | Default | Description |
|---|---|---|---|
size | "xs" – "9xl" (type scale) | "md" | Font size token. |
weight | "thin" | "extralight" | "light" | "normal" | "medium" | "semibold" | "bold" | "extrabold" | "black" | — | Font weight token. |
color | "base" | "muted" | "subtle" | "inverted" | status tokens | palette shades | "base" | Text color from semantic roles or raw palette shades. |
align | "left" | "center" | "right" | "justify" | — | Text alignment. |
casing | "uppercase" | "lowercase" | "capitalize" | "normal" | — | Text transform. |
lineHeight | "none" | "tight" | "snug" | "normal" | "relaxed" | "loose" | — | Leading token. |
letterSpacing | "tighter" | "tight" | "normal" | "wide" | "wider" | "widest" | — | Tracking token. |
fontFamily | "heading" | "body" | "sans" | "serif" | "mono" | — | Font family token. |
fontStyle · textDecoration | "italic" · "underline" | "line-through" | "overline" | "none" | — | Style and decoration. |
truncate | boolean | false | Single-line ellipsis overflow. |
lineClamp | "1" – "6" | — | Multi-line clamp with ellipsis (ignored when truncate is set). |
gutterBottom · paragraph | boolean | false | Rhythm helpers — small / paragraph-sized bottom margin (paragraph also forces a <p>). |
as | ElementType | "p" | Rendered element — span, label, figcaption, … |