Installation
Apollion ships as
@apollion-dsi/core, with React 19 and styled-components 6 as peer dependencies. The
repository and its tooling use Yarn.Start
yarn add @apollion-dsi/core styled-components@^6 react@^19 react-dom@^19
Import from subpaths
Every component and theme module has its own subpath, such as @apollion-dsi/core/elements/button or
@apollion-dsi/core/themes. The package root exports only the version constant, and the
no-restricted-imports rule in @apollion-dsi/eslint-config rejects it.
Render the first component
Wrap the application root in ApollionProvider once. Every component reads the theme from it.
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { Button } from '@apollion-dsi/core/elements/button';
import { ApollionProvider } from '@apollion-dsi/core/themes';
createRoot(document.getElementById('root')!).render(
<StrictMode>
<ApollionProvider>
<Button text="Hello" />
</ApollionProvider>
</StrictMode>,
);Without props the provider uses the stock theme. To set brand colors, dark mode and density, continue with the Quick Start.
Tokens outside React
To consume the theme as CSS custom properties, JSON or TypeScript — in another framework or in static
HTML — add @apollion-dsi/tokens and build from a config file. See Token Build.