Skip to Content
CodeUI

Installation

@codeui/solid v0.3.0

Install static styles and the Solid components.

Requirements

The component package requires Solid 2 and @solidjs/web. It uses Kobalte 2.0.0. Its styles are plain CSS. The library builds the Inkstone theme from DTCG tokens before publishing.

Install

pnpm add @codeui/solid solid-js@^2 @solidjs/web@^2
pnpm add -D vite@^8 @solidjs/vite-plugin@^3

Configure Vite

vite.config.ts
import { defineConfig } from "vite";
import solid from "@solidjs/vite-plugin";

export default defineConfig({
	plugins: [solid()],
});

Set jsxImportSource to @solidjs/web in tsconfig.json. To upgrade an existing project, follow the Solid 2 migration guide.

Automatic styles

Import a Solid component normally. Its module imports the compiled component stylesheet, shared styles and theme.

App.tsx
import { Button } from "@codeui/solid";

No manual CSS import is required. With production tree shaking, unused component modules and their CSS can be removed. All variants and runtime states of an included component remain available. The library does not purge individual selectors.

Use a component

Export snippet

Save a PNG for your documentation.
Settings are ready to save.
first-component/export-screen.tsx
import { createSignal } from "solid-js";
import { Button, Stack, Text, TextField } from "@codeui/solid";
export default function ExportScreen() {
	const [name, setName] = createSignal("Fetch example");
	const [saved, setSaved] = createSignal(false);
	return <Stack gap="4" style={{ padding: "var(--cui-space-4)", background: "var(--cui-surface-canvas)", "border-radius": "var(--cui-radius-card)", width: "100%", "max-width": "360px" }}>
		<Text as="h2" size="md" weight="semibold">Export snippet</Text>
		<TextField label="Snippet name" value={name()} onChange={value => { setName(value); setSaved(false); }} />
		<Text size="xs" tone="muted">Save a PNG for your documentation.</Text>
		<Stack direction="row"><Button variant="primary" disabled={!name().trim()} onClick={() => setSaved(true)}>Save export settings</Button></Stack>
		<Text size="xs" tone="muted" role="status">{saved() ? `Settings saved for ${name()}.` : "Settings are ready to save."}</Text>
	</Stack>;
}

Import ready components from @codeui/solid or a component entry such as @codeui/solid/button. Import styled parts from the component’s /parts entry. See Ready or parts.

Pick a theme

Set data-cui-theme="dark" or data-cui-theme="light" on the document's html element. Portalled content then inherits the page theme too. Without an explicit attribute, the theme follows the system color scheme.

See Theming for plain CSS overrides. Applications that author their own vanilla-extract styles still configure their own plugin for those files. The kit does not require it.

CSS without Solid

Install only @codeui/styles to use the compiled CSS in HTML or another rendering system. It does not require a framework runtime. Load theme.css and the component files through your bundler or ordinary stylesheet links.

The CSS provides appearance and state styling. The caller supplies markup, accessible names and behavior. Focus management, positioning, keyboard navigation, gestures and virtualized lists belong to the Solid components.

Inkstone tokens

Install @codeui/inkstone to use the theme in your own UI. Load @codeui/inkstone/theme.css for the CSS custom properties. Import tokens, themeValues, and breakpoints from the package entry, or use the resolved light and dark JSON in other tools. Token generation describes the outputs.

Server rendering

Use the package's solid condition with Solid's server compiler, as the fixture does through solid({ ssr: true }). Dialog, Popover, Sheet and CommandMenu include their open content in server HTML. Hydration adopts those nodes and moves them to the portal target. Closed content stays absent unless force-mounted.

The packed-consumer SSR and hydration checks are documented in docs/kit-2026/consumer.md and examples/ in the repository.

On this page