Theme Scope
Applies a Syntara theme, colour scheme and density to everything inside it.
Preview
Card ending 4821
Replacement card dispatched. Activate it when it arrives.
Home policy renews 14 Oct
Check your rebuild value before your renewal price is set.
طلب QM-58213
طلبك في الطريق ويصل اليوم بين 6 و 8 مساءً.
Installation
pnpm add @syntara/react @syntara/tokensimport { ThemeScope } from '@syntara/react';Usage
import { ThemeScope } from '@syntara/react';
export function App() {
return (
<ThemeScope theme="qamar" scheme="dark" locale="ar-AE">
{/* your app */}
</ThemeScope>
);
}Accessibility
No keyboard interaction of its own.
- Pass locale for other-language or right-to-left regions: React Aria reads direction from the locale, not the DOM dir attribute.
- Overlays opened inside the scope copy its theme, scheme, density, dir and lang when they open.
Guidelines
Do
- Put the theme, scheme and density attributes on one element — token CSS needs them together.
Don’t
- Don't nest scopes with different schemes inside inline text; scope whole regions.
API reference
ThemeScope
themestringTenant id whose tokens are loaded under [data-syntara-theme]. Omit to inherit the page theme.
schemelightdefaultdark
Colour scheme for the subtree.
densitycomfortablecompact
Overrides the tenant's default density.
localestringBCP 47 locale, e.g. "ar-AE". Sets React Aria's locale (arrow-key direction, date formats, placement) and, unless given, lang and dir. Right-to-left regions need it.
Tokens
The semantic tokens this component reads, grouped by what they control. Swatches show this site’s theme; change a tenant’s brand and the component follows with no code change.
- Colour2
surface.canvastext.default- Type2
font.bodyfont.size.md