Write every variant once. Get every combination, dark mode included.
Describe states, sizes and variants as separate dimensions and rocketstyle turns each into a typed prop, with mode(light, dark) right next to the value. Underneath: the CSS-in-JS engine that beat Emotion and goober on every operation we timed, plus layout primitives, a responsive grid and motion.
bun add @pyreon/rocketstyle @pyreon/elements @pyreon/ui-core @pyreon/unistyle - dimensions
- states · sizes · variants · multiple · modifiersPlus your own. Each one is a typed prop.
- CSS engine
- won 4 of 4 timed ops vs Emotion and gooberOvernight run, one run, bun.
- dark mode
mode(light, dark)beside the valueWith CSS variables on, a flip is one attribute write.- native
styled(Prim), Element, grid and rocketstyle lower to SwiftUI and ComposeExperimental. A reactive dimension flip is device-tested.


- 6.3× faster than Emotion at serving a style it has already seen (warm dedup)BENCHMARKS.md 2026-11-05 §9 Styler, overnight run, one run
- 4 / 4 timed operations where styler beat both Emotion and gooberBENCHMARKS.md 2026-11-05 §9 and §12 (styler row), overnight run, one run
- 2.3× faster than styled-components at collecting styles for server rendering (its figure includes a React render pass)BENCHMARKS.md 2026-11-05 §9 Styler (SSR collect), overnight run, one run
synthetic · author-run · M3 Max · record of 2026-11-05
Every result, including where we lose →The parts of a design system every team rebuilds.
Dimensions, not branches
.states(),.sizes()and.variants()each describe one axis.<Button state="danger" size="lg">merges base → state → size → variant at render. Five dimensions are built in, and a custom one (tones→tone="warn") is one line of config.Dark mode lives next to the value
Write
mode('#c2410c', '#ff5e1a')inside.theme()or any dimension.<PyreonUI mode="system">follows the OS, andinit({ cssVariables: true })turns a flip into one attribute write on<html>.An engine that wins its benchmarks
styler beat Emotion by 3.4–6.3× and goober by 2.2–4.0× on cold insert, warm dedup, dynamic resolve and SSR collect; SSR collect also beat styled-components 2.3× (one run). Rules dedupe by hash, and the SSR
<style>takes a CSP nonce.One system for iOS and Android too
styled(Prim),Element, coolgrid, attrs,<PyreonUI>and rocketstyle chains over a primitive lower to SwiftUI and Compose, withdefineThemetokens resolved at compile time. Experimental: a rocketstyle state flip is asserted on both device gates.
Variants as data, not as ternaries.
Each dimension is a ternary inside every rule it touches, and dark mode nests another one inside that.
import styled from 'styled-components'
declare module 'styled-components' {
interface DefaultTheme { dark: boolean }
}
type Props = { $state?: 'primary' | 'danger'; $size?: 'sm' | 'md' | 'lg' }
const Button = styled.button<Props>`
border-radius: 6px;
color: ${(p) => (p.theme.dark ? '#0a0a0e' : '#fff')};
padding: ${(p) =>
p.$size === 'sm' ? '6px 12px' : p.$size === 'lg' ? '10px 20px' : '8px 16px'};
background: ${(p) =>
p.$state === 'danger'
? p.theme.dark ? '#f87171' : '#b91c1c'
: p.theme.dark ? '#ff5e1a' : '#c2410c'};
`
<Button $state="danger" $size="lg">Delete</Button>Each dimension is declared once and becomes a typed prop. Dark mode is mode() beside the value.
import rocketstyle from '@pyreon/rocketstyle'
import { Element } from '@pyreon/elements'
const Button = rocketstyle()({ name: 'Button', component: Element })
.attrs({ tag: 'button' })
.theme((t, mode) => ({
borderRadius: 6,
paddingX: 16,
paddingY: 8,
color: mode('#fff', '#0a0a0e'),
}))
.states((t, mode) => ({
primary: { backgroundColor: mode('#c2410c', '#ff5e1a') },
danger: { backgroundColor: mode('#b91c1c', '#f87171') },
}))
.sizes({
sm: { paddingX: 12, paddingY: 6 },
lg: { paddingX: 20, paddingY: 10 },
})
<Button state="danger" size="lg">Delete</Button>Eleven packages, one system.
Use the whole thing through your components, or take only the layer you need: styler works on its own.
States, sizes, variants and your own axes as typed props.
styled, css, keyframes and global styles, deduplicated and SSR-safe.
Breakpoints, responsive values and themes as CSS variables.
Chainable default props; call-site props always win.
Element, Text, List, Overlay and Portal.
Container, Row and Col with your own columns and breakpoints.
PyreonUI: theme and light, dark or system mode in one component.
Enter, leave, collapse, stagger and keyed-list animation on CSS transitions.
See Motion →122 ready-made animations, imported one by one.
18 document components (DocPage, DocTable, DocText…) themed like the rest of your UI.
The bridge from ui-system components to the @pyreon/document export pipeline.
Coming from styled-components?
Keep your tagged templates.
import styled from 'styled-components'
const Tab = styled.button<{ $active?: boolean }>`
padding: 8px 14px;
border: 0;
border-bottom: 2px solid ${(p) => (p.$active ? '#ff5e1a' : 'transparent')};
color: ${(p) => (p.$active ? '#0a0a0e' : '#6b6b76')};
&:hover { color: #0a0a0e; }
`
export const Tabs = () => (
<nav>
<Tab $active>Overview</Tab>
<Tab>Settings</Tab>
</nav>
)Same template syntax, same $-transient props; the import changes. styled.button works too. For iOS and Android, wrap a primitive instead of an HTML tag: styled(Prim) is the form the native compiler lowers.
import { styled } from '@pyreon/styler'
const Tab = styled('button')<{ $active?: boolean }>`
padding: 8px 14px;
border: 0;
border-bottom: 2px solid ${(p) => (p.$active ? '#ff5e1a' : 'transparent')};
color: ${(p) => (p.$active ? '#0a0a0e' : '#6b6b76')};
&:hover { color: #0a0a0e; }
`
export const Tabs = () => (
<nav>
<Tab $active>Overview</Tab>
<Tab>Settings</Tab>
</nav>
)Change the dimensions.
One component, every combination of state, size and variant, in light or dark mode. The props on the right are all the code a consumer writes.
<Button
state="primary"
size="md"
variant="solid"
>Delete</Button>
// mode comes from <PyreonUI mode="light">Delete project?
This removes the project and its 12 deployments.
The fastest CSS-in-JS engine we measured, on all four operations.
styler is the engine under every rocketstyle component. Static styles resolve once; repeats hit a hash-keyed dedup cache, and SSR collection inserts each rule in constant time. styled-components appears only in SSR collect, where its figure includes a React render pass.
- warm dedup (repeat identical CSS)win6.34× vs Emotion · 3.81× vs goober
- dynamic resolve (prop interpolation)win5.26× vs Emotion · 2.17× vs goober
- SSR collectwin3.56× / 3.99× / 2.30× vs Emotion / goober / styled-components
- cold insert (fresh sheet)win3.38× vs Emotion · 3.59× vs goober
Eleven packages that make one design system.
- rocketstyle: five built-in dimensions plus your own, each a typed prop, with results cached per definition
- Pseudo-states as objects:
hover,focus,active,pressedanddisabledcompile to CSS selectors - styler:
styled(),css,keyframes,createGlobalStyle,$-transient props andas - Server rendering: per-request sheets, a CSP nonce on the critical
<style>, and a streaming flush - elements: Element, Text, List, Overlay and Portal layout primitives
- useOverlay: dropdowns, tooltips and modals with viewport flip, Escape, click-outside and a focus trap for modals
- coolgrid: Container, Row and Col; every numeric prop takes a value, a mobile-first array or a breakpoint object
- PyreonUI: one provider for theme and mode, plus
cssVariablesPrePaintScript()so dark mode never flashes - attrs: chainable default props on any component, and whatever the call site passes still wins
- More of it on native:next release several dynamic dimensions, nested style ternaries, pressed styles and
<List>lower to iOS and Android
Things to build with it.
PyreonUI takes a signal-driven mode. The card declares both colours once; flipping the signal swaps its class, nothing remounts.
import { signal } from '@pyreon/reactivity'
import { PyreonUI } from '@pyreon/ui-core'
import { enrichTheme } from '@pyreon/unistyle'
import rocketstyle from '@pyreon/rocketstyle'
import { Element } from '@pyreon/elements'
const theme = enrichTheme({ rootSize: 16 })
const Card = rocketstyle()({ name: 'Card', component: Element })
.attrs({ direction: 'rows', gap: 8 })
.theme((t, mode) => ({
padding: 24,
borderRadius: 12,
backgroundColor: mode('#ffffff', '#16161d'),
color: mode('#0a0a0e', '#f4efe6'),
}))
export function App() {
const scheme = signal<'light' | 'dark'>('light')
return (
<PyreonUI theme={theme} mode={() => scheme()}>
<button onClick={() => scheme.update((m) => (m === 'light' ? 'dark' : 'light'))}>
Toggle theme
</button>
<Card>One definition, both modes.</Card>
</PyreonUI>
)
}One column on phones, two from sm, three from md. Array values are mobile-first and cascade upward.
import { For } from '@pyreon/core'
import { PyreonUI } from '@pyreon/ui-core'
import { Container, Row, Col, theme } from '@pyreon/coolgrid'
const products = ['Zero', 'Native', 'Charts', 'Forms', 'Flow', 'Table']
export const ProductGrid = () => (
<PyreonUI theme={theme}>
<Container gap={16}>
<Row>
<For each={products} by={(name) => name}>
{(name) => <Col size={[12, 6, 4]}>{name}</Col>}
</For>
</Row>
</Container>
</PyreonUI>
)One import per job.
Every export has a reference page with its signature, an example and the mistakes people make with it.
- rocketstyle
- Provider
- isRocketComponent
- resolveModeVar
- resolveTheme
- styled
- css
- keyframes
- createGlobalStyle
- useCSS
- defineTheme
- useTheme
- useThemeAccessor
- createSheet
- sheet
- Element
- Text
- List
- Overlay
- useOverlay
- Portal
- Container
- Row
- Col
- PyreonUI
- useMode
- init
- enrichTheme
- themeToCssVars
- cssVariablesPrePaintScript
- makeItResponsive
- breakpoints
- kinetic
- presets
- useTransitionState
- DocDocument
- DocPage
- DocText
- DocTable
- extractDocNode
- DocumentPreview
Good to know before you start.
You build the components
These packages are the system, not a widget kit. A ready-made component library built on them exists in the repo but is not published yet, so today your Button is about twenty lines of rocketstyle.
Give the grid its theme
Container, Row and Col read columns and breakpoints from context. Render them under <PyreonUI theme={theme}>; a theme without grid keys falls back to coolgrid's defaults (12 columns, xs–xl breakpoints).
CSS variables buy a clean flip, not speed
cssVariables mode makes dark mode one attribute write with no flash. In our overnight run (300 components flipping 20 times, nine runs on a dev server), classic mode was 1.13× faster, so pick it for the flip, not the clock.
Native lowers the authored patterns
The CSS runtime stays on the web. Responsive values, Overlay, Portal and arbitrary selectors warn by name in a native build.
What people ask first.
Do I need all eleven packages?
No. styler has no other ui-system dependency and works on its own. rocketstyle brings styler and ui-core; elements and coolgrid bring unistyle. kinetic and the document packages are separate installs.
Does changing the theme or mode re-render my components?
No. A theme or mode change re-resolves the CSS and updates the class name in place; components run once and nothing remounts.
Can I still use Tailwind?
Yes for markup: class is passed through as written, and kinetic takes Tailwind utilities through .enterClass() / .leaveClass(). The design system earns its place when you want themed, dimensioned components with dark mode built in.
Does it work with SSR and streaming?
Yes. sheet.getStyleTag(nonce) inlines the critical CSS for string rendering, createSheet() isolates a request, and a streaming flush sends only the rules each chunk needs.
How fast is it, really?
In our overnight run, styler beat Emotion and goober on all four timed operations and styled-components on SSR collect. One run, author-run, synthetic; the reproduce command is bun scripts/bench/core/styler.ts.
Built to be used together.
Primitives
The cross-platform components your styles wrap on web, iOS and Android.
Atlas
Scenarios generated from your rocketstyle dimensions.
Motion
Enter and leave animations with 122 presets.
Documents
Render one document tree to PDF, DOCX and 18 more formats.
Name each dimension once. Stop naming the combinations.
bun add @pyreon/rocketstyle @pyreon/elements @pyreon/ui-core @pyreon/unistyle