Components
/
Primitives
Primitives
The token-styled building blocks — the shadcn layer that everything else composes from.
View as Markdown
llms.txt
The primitives are the token-styled building blocks the data-connected components compose from. Import and use them directly; they paint themselves from the active theme.
app/example.tsx
tsx · copy
1
import
{
Button
,
Input
,
Field
,
Card
,
Stack
}
from
"rastack/components"
;
2
3
<
Card
>
4
<
Stack
gap
=
"md"
>
5
<
Field
label
=
"Airport code"
>
6
<
Input
placeholder
=
"HND"
/>
7
</
Field
>
8
<
Button
>
Save
</
Button
>
9
</
Stack
>
10
</
Card
>
What's included
Controls Button, Input, Textarea, Select, Checkbox.
Field Label, Field, FieldError, FieldHint.
Table Table, THead, TBody, Tr, Th, Td.
Misc Spinner, Badge, Card, Stack.
The styling contract
Every primitive is painted only through var(--…) token references — nothing hard-coded. style.ts exposes the semantic set the kit paints from — color.{surface,border,text,text-muted,accent,on-accent,success,danger,warning}, space.*, radius.*, font.*, shadow.* — each with a literal fallback so components stay legible with a partial token set, or before any theme is wired.
Tip
Because cssVar(path) uses the same cssVarName as the token compiler and <ThemeProvider>, the variable names can never drift from your design system. Theme it once; every primitive follows.
Build with AI
Every page is available as clean Markdown for LLMs and coding agents. Point one at the files below to build on top of React API Stack.
React API Stack · alpha · built to scale to millions