Ecosystem
The Playa theme
Themed components and a build-time UnoCSS preset.
Add components and the preset
Playa combines component families with design tokens, icons and UnoCSS recipes. Its UnoCSS peer is exact: use 66.7.2.
pnpm add ajo-ui-playa@0.1.2
pnpm add -D unocss@66.7.2Enable Playa at build time
Import playa() from the package root. Keep application shortcuts and dynamic icon safelists in your own config.
import { defineConfig } from 'unocss'
import { playa } from 'ajo-ui-playa'
export default defineConfig({ presets: [playa()] })Load styles before hydration
Add the UnoCSS plugin, then import virtual:uno.css from the root layout. This makes the same stylesheet available during local development and the production build. Imported Playa families carry the UnoCSS discovery marker.
import { defineConfig } from 'vite'
import { kit } from 'ajo-kit/vite'
import unocss from 'unocss/vite'
export default defineConfig({
plugins: [...kit(), unocss()],
optimizeDeps: { exclude: ['ajo-kit/client'] },
})Import the stylesheet
The root layout owns the generated CSS. Put your own application stylesheet after it if you want to customize the theme.
import 'virtual:uno.css'
import type { LayoutArgs } from 'ajo-kit'
export default ({ children }: LayoutArgs) => childrenImport an explicit family
Runtime components use subpaths. A Button can render a real anchor so navigation keeps native link semantics. This website uses Playa for its actions.
import Button from 'ajo-ui-playa/button'
export default () => (
<Button as="a" href="/docs" variant="outline">
Read the docs
</Button>
)