-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
🔄 Auto-generated mirror. Canonical source:
docs/quick-start.md. Edit there — changes here are overwritten by CI.
Nav: Quick start · Writing cases · Hierarchy · Tweaks · Theming · Documentation panel · Writing placard docs · Testing · CLI · AI agents · Configuration
Get a component browsing in a few minutes. Everything here runs on Bun — no bundler config, no separate dev server.
Display Case looks for a display-case.config.ts at the root of the package it is pointed at. It must default-export defineConfig(...).
// display-case.config.ts
import { defineConfig } from '@awarebydefault/display-case'
export default defineConfig({
title: 'Display Case',
roots: ['src/components/**/*.case.tsx'],
globalStyles: ['./src/tokens.css', './src/components.css'],
})-
titleshows in the browsing chrome and the manifest. -
rootsare globs (relative to the package) that locate your case files. -
globalStylesare CSS entrypoints injected into every preview, so components render with their real tokens and styles.
Full reference: Configuration.
A case file is *.case.tsx, colocated with the component it showcases. It default-exports defineCases(...).
// src/components/tweak-control.case.tsx
import { defineCases } from '@awarebydefault/display-case'
import { TweakControl } from './tweak-control'
export default defineCases('TweakControl', {
Variants: () => (
<div style={{ display: 'flex', gap: '0.5rem', flexWrap: 'wrap' }}>
<TweakControl kind="text" label="Label" value="Save" />
<TweakControl kind="choice" label="Variant" options={['default', 'outline']} value="default" />
<TweakControl kind="boolean" label="Disabled" value={false} />
</div>
),
}, { level: 'atom' })The render functions are lazy thunks — they only run when a case is viewed or screenshotted. Keep the module side-effect-free at the top level; the server imports it to build the manifest without ever calling them.
Point the CLI at the package directory:
bunx @awarebydefault/display-case .Or wire up an npm script and use that:
bun run display-caseThe server prints its URL (default http://localhost:3100). Open it and you'll see your components grouped by hierarchy level in the sidebar, with each case rendered in an isolated frame.
Change a *.case.tsx or *.placard.md file and the server rebuilds automatically. There is no in-page hot reload — refresh to pick up the change.
- Add interactive controls: Tweaks.
- Group and order components: Hierarchy.
- Document a component inline: Documentation panel.
- Catch regressions: Testing.
Auto-generated mirror of the Display Case docs. Edit the repo, not the wiki.
Product documentation
- AI Agents
- CLI
- Configuration
- Documentation Panel
- Examples
- Hierarchy
- Quick Start
- Style Engines
- Testing
- Theming
- Tweaks
- Writing Cases
- Writing Placard Docs
Contributing (engineering)