Strata Docs
Everything you need to install, configure, and sync your design system in minutes.
Quick start
Create a project
Go to strata.charisol.io, create a project, and import your design tokens from a Style Dictionary JSON or Figma file.
Get your project ID & token
Open the Publish & Sync tab on your project dashboard. Copy your project ID and generate a sync token.
Install the package
Run npm install @strata-ds/core. Works with React 18+, Next.js App Router, and Pages Router.
Wrap and use
Add StrataProvider at your app root, pass projectId, snapshotCdnBase, and syncToken, then call useComponents() anywhere inside.
Installation
npm install @strata-ds/core
# yarn
yarn add @strata-ds/core
StrataProvider setup
Wrap your root layout with StrataProvider. Pass your projectId, snapshotCdnBase, and syncToken. It polls every syncInterval ms (default 3000) and updates all consuming components without a reload.
| Prop | Type | Default | Description |
|---|---|---|---|
syncEnabled | boolean | false | Enable live polling from the Strata backend. |
syncUrl | string | — | Legacy — base URL from your project dashboard. Prefer snapshotCdnBase + projectId instead. |
syncInterval | number | 3000 | Polling interval in milliseconds. |
projectId | string | — | Your Strata project ID. Required when using snapshotCdnBase. |
snapshotCdnBase | string | — | CDN base URL for snapshot fetches. A single edge-cached request replaces 3 Lambda calls. |
syncToken | string | — | Sync token from the Publish & Sync tab. Adds Authorization: Bearer to all sync requests. |
Using components with useComponents()
useComponents() returns a map of every component you defined in your Strata project, keyed by PascalCase name. Render them conditionally — they are undefined while the first sync is in flight.
Web Components integration
If your app is not React-based, use the Web Components package. Register the elements once at startup, then use custom elements directly in HTML.
Build-time vs runtime
Build-time sync
Compile tokens and components at deploy time. Ideal when release governance is strict.
Runtime sync
Poll every 3 seconds and apply updates live, including structural component changes.
Hooks reference
| Hook | Returns | Description |
|---|---|---|
useComponents() | Record<string, React.ComponentType> | Map of all registered PascalCase components. |
useComponent(name) | React.ComponentType | null | Single component by name. |
useStrata() | StrataContextType | Full context: designSystem, syncStatus, lastSynced, forceSync, syncUrl, syncEnabled. |
useDynamicComponents() | ComponentRegistry | Raw registry map before PascalCase normalisation. |
TypeScript types
The Strata SDK is fully typed. All hooks and components export TypeScript definitions for complete IDE autocomplete and type safety.
Debugging
Drop <StrataDebug /> anywhere inside StrataProvider during development. It renders a panel showing sync status, last synced timestamp, the sync URL, and all registered component names.