# Inlay UI development decisions

Decided December 1, 2026.

## Distribution

Inlay UI is a source-first component library. Developers try a component in the docs, select HTML, React, or Vue, and copy the source into their own project. They can edit those files and commit them with their application. The docs show the actual source for each target. Keep the live example visible, expand source below it, and give installation its own copy control. Copy page includes the selected framework source, installation, and usage as Markdown. [shadcn/ui Button](https://ui.shadcn.com/docs/components/base/button)

The framework-neutral npm foundation provides CSS tokens, component styles, and small JavaScript modules that a component can import when needed. The [foundation manifest](../../inlay/packages/foundation/package.json) records the current local package version and exports. No framework or Tailwind is required by the package. The initial release is a local tarball for testing. The npm scope, public release, and final license are pending.

## Typography

Use Geist for the display role and keep the system-first body and control type. The foundation bundles the Google Fonts Latin variable file under its SIL Open Font License. [Geist on Google Fonts](https://fonts.google.com/specimen/Geist)

## Component authoring

Keep one definition per component. The definition owns the canonical markup, example text, usage notes, and any explicit dependencies. The site renders the live preview and produces the code choices from that definition. Use `ilui-` for public component class names, `--ilui-` for CSS variables, and `data-ilui-` for behavior hooks. Keep syntax colors in the documentation code viewer, where they distinguish keywords, strings, tags, and attributes in both themes. Shared CSS and runtime behavior belong in the foundation package. The developer examples use the same snippets exported by the site.

Validate a component by installing the packed foundation in a clean project, then running the docs snippet in each supported framework. Test the real browser behavior as well as compilation. Button and Dialog are the first cases: Button relies on native semantics alone, while Dialog exercises runtime imports, keyboard dismissal, unique IDs, and focus restoration.

## Form controls

Standard buttons and text-entry controls use a shared 10 px radius. Compact actions use 8 px. Toolbars, grouped controls, overlays, and frames use 14 px. Switch tracks, progress tracks, and other shape-specific elements keep their round treatment. [coss ui Button](https://coss.com/ui/docs/components/button) · [coss ui Toolbar](https://coss.com/ui/docs/components/toolbar)

Use a 1 px translucent edge. Frames and separators use white at 6% in dark mode and black at 8% in light mode. Field edges use white at 8% or black at 10%. Keep check, radio, and switch state boundaries and the dedicated focus and validation colors visually distinct. [coss ui Styling](https://coss.com/ui/docs/styling)

## Spacing

Use the semantic spacing roles in the source tokens. A field puts its label first, the control next, and support text or validation below. Field rows use 8 px gaps and 16 px label and message line heights. Field stacks use 24 px gaps. Standard panels use 16 px inset and dialogs use 24 px. Authoring examples can use the registry’s field helper, which supplies label linkage, message references, and the shared layout classes. The example generator rejects fields with invalid slot order or inline spacing overrides. [coss ui Field](https://coss.com/ui/docs/components/field)

## Motion defaults

Motion is a foundation feature. Keep the tokens in `design-tokens.json` and the patterns in `motion.css`. Importing the primitives loads the defaults across HTML, React, and Vue. New components should map their native or ARIA state to a shared pattern before introducing their own motion.

| Pattern | Default | Use it for |
| --- | --- | --- |
| Feedback | 120 ms | Hover, press, and selection. |
| Enter | 240 ms | Bring an overlay into view with deceleration. |
| Exit | 160 ms | Clear an overlay once the user dismisses it. |
| Disclosure | 220 ms | Reveal content without losing the relationship to its trigger. |

Animate visual properties such as color, opacity, and transform for routine interaction. Use size animation for a bounded disclosure only where the browser supports it. Treat native state, focus, and keyboard input as immediate. Attach reduced-motion behavior through the shared stylesheet, honor user preference, and provide a subtree opt-out.

For every new component, verify opening and closing, rapid reversal, the keyboard path, and reduced motion. Use those same durations for the docs shell. Keep navigation mounted so the active rail can move between items while the document pane transitions. Use View Transitions where available, with an entrance-only fallback. Record browser fallbacks where an enhancement needs newer CSS. Keep the example interactive even when the effect is unavailable.

[CSS Transitions Level 2](https://www.w3.org/TR/css-transitions-2/) · [HTML dialog](https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element)

### Selection motion

For a single selected row within a group, use one persistent `ilui-selection-indicator` with the shared disclosure duration and entrance easing. Put it inside a positioned `data-ilui-selection-track`, add `data-ilui-selection-item` to each row, and mark the indicator `aria-hidden="true"`. Import `@inlay-ui/foundation/selection` once. Keep the native radio or ARIA state as the source of selection. Preserve a static selected style until the indicator is active. Radio group provides the working implementation, and the sidebar uses the same indicator styles.

Verify both directions, quick reversals, keyboard input, and reduced motion in a browser. The selected state must be correct throughout the animation. Confirm that copied HTML, React, and Vue preserve the same behavior.

### Navigation and overlays

The signed-in Macro channel menus measured 256 px wide with a 12 px surface radius and 32 px action rows. Tab labels used 14 px type in a compact row. The channel creation dialog measured 600 px wide with 24 px corners. Inlay carries those measurements into its own menu, tab, and modal styles. Breadcrumb, numbered pagination, and the modal drawer adapt nearby patterns. Use the shared selection indicator for tabs and page controls. The expanded examples cover collapsed hierarchy, real result pages, selectable menu items, and form and scrolling overlays. [shadcn/ui Breadcrumb](https://ui.shadcn.com/docs/components/base/breadcrumb) [Macro workspace stylesheet](https://macro.com/app/assets/startup-app-canvasRender-1-yDJ9DZBA.css)

## First verification

All three examples installed the actual npm archive from a clean directory and built for production. Six docs copy payloads matched the source compiled by those projects. The browser checks covered Button keyboard activation and disabled state, Dialog initial focus, Escape and confirmation, focus restoration, and separate Dialog instances in React and Vue. The plain HTML example uses Vite only to resolve npm imports and build its assets.

## Paid source

The proposed paid product is a one-time purchase tied to an Inlay UI account. Keep standard foundation files public. Serve premium authored source only after Inlay UI checks the user’s entitlement at the API that returns that source. A future CLI and MCP server should use the same entitlement check. Developers who have copied the files can build and deploy their own projects without an Inlay UI token.

The first prototype uses public development examples. Pricing, the paid catalog, account access, and the commercial license remain product decisions.

## Registry, CLI, and MCP

Design the component record so it can later return a stable identifier, source version, framework, files, dependencies, and usage notes. Docs, a future CLI, and MCP can then use the same record.

The CLI can later add requested files into the developer’s project, preview paths, and ask before overwriting local edits. The local MCP server uses stdio and the same definitions and source renderer as the docs. It lists available and planned catalog entries and returns the exact HTML, React, or Vue snippet, its source hash, and foundation setup. Purchaser access will use the entitlement API when that API exists. [MCP setup](../../inlay/mcp/README.md)

[KTUI installation](https://ktui.io/docs/installation) · [shadcn/ui registry](https://ui.shadcn.com/docs/registry) · [MCP server concepts](https://modelcontextprotocol.io/docs/learn/server-concepts)

## Catalog expansion

Popover and Calendar supply the interaction and layout patterns used by Date Picker. Meter and Progress share track styling while preserving their native semantics. Feature examples use the shared foundation classes and motion tokens. The workspace examples keep their state in the page and can be connected to application data by the consuming project.

The docs and MCP read the same registry for components, variations, and blocks. The example generator builds the HTML, React, and Vue fixture apps from those definitions. Run the generator after changing a component or adding a variation.

### Workspace blocks

Build blocks around a complete task such as triaging an inbox item, finding a file, or preparing an agent prompt. Use the shared corner, spacing, surface, and selection tokens. Stack split panels when the block itself gets narrow so the example also works in an embedded layout. Keep one registry record per block for preview, framework source, and MCP. Block demos use sample records and hand off app actions through bubbling events. [Signed-in Macro inventory](macro-workspace-inventory.md)

### Shared controls in blocks

Native controls are the portable Inlay API. Keep native `<button>` markup in HTML, JSX, and Vue templates, with an explicit type and a shared `ilui-button` class. Use the matching foundation primitive and runtime for specialized controls. Block code owns local workflow state, and block styles own composition. When there is an existing authoring helper, compose it into the block so the docs, fixtures, and MCP all render the same source. Run the reuse guard and the field-spacing check through the example generator.

### Mailbox Button pilot

The initial Mailbox Thread pilot used shared Button imports for React and Vue. Each adapter renders one native button and uses the existing foundation CSS. HTML, the docs preview, and the authored definition still use native markup. The pilot measured Mailbox Thread in isolation.

The benchmark built one Mailbox page for each framework with Vite 7.3.6, React 19.2.8, and Vue 3.5.11, using the same entry, runtime imports, and styles with the packed foundation before and after. Gzipped JavaScript went from 64,964 to 65,120 bytes for React and from 27,864 to 28,256 bytes for Vue. HTML JavaScript stayed at 3,714 bytes. Shared CSS was byte-for-byte identical and each build emitted one JavaScript asset. These are transfer-size measurements for this example.

### Shared Button rollout

All registered blocks and block variations now generate shared Button imports in React and Vue when they contain buttons. HTML and the live preview use the same authored native markup. A button-free block needs no adapter import. The example generator checks all three forms of the snippet.

### Composition across components and blocks

Authored examples use native controls and shared classes. React and Vue snippets import the matching adapters for Button, Input, Select, Checkbox, Avatar, Textarea, FileInput, Meter, and Progress, including within larger components and variations. A shared adapter renders the same native control and forwards native attributes. HTML keeps the authored markup and shared behavior modules. The snippet generator checks this rule across the catalog.

### AI elements

The AI catalog covers the 21 patterns listed by shadcn/ui plus the linked Trace, Attachment, Message Scroller, and Questionnaire components. Inlay composes their examples from native markup, existing controls, disclosure and selection motion, and one local interaction module. Run and approval previews use fictional data. Local actions emit browser events for the consuming app. [AI Elements reference](https://ui.shadcn.com/docs/ai-elements)

### AI replay motion

The live shadcn/ui reference uses a running trace, sequential steps, and a final reply. Inlay uses that flow with its own conversation bubble, trace rails, badges, and tokens. The AI demos expose Replay for the 11 reference patterns that replay, plus the shared Trace demo. Trace disclosures support older browsers through a Web Animations fallback. Respect manual disclosure choices during replay and use reduced motion for the user preference and the local override. [Chain of Thought reference](https://ui.shadcn.com/docs/ai-elements/base/chain-of-thought)

Animate list changes with shared enter, feedback, and exit timings. Give exiting rows a brief visual fade while committing the filter or removal immediately so keyboard focus and screen-reader results stay current. Keep typing and native control selection immediate.

On component pages, previews with Replay run once on entry when they become visible, after the page transition. Prompt Input demonstrates typing with sample placeholder text. Automatic playback is scoped to the docs and respects reduced motion and direct interaction with the preview.

### Statistic cards

Register all 15 patterns as one Blocks collection. Each example has its own preview and source, generated from the same native markup for HTML, React, Vue, and MCP. Reuse the existing Card styles and framework control adapters. Reporting filters and example actions operate on sample data. Use Inlay tokens for styling and the shared selection indicator for adoption chart navigation. [ReUI statistic card references](https://v1.reui.io/blocks/cards/statistic-cards)

Use semantic color for trends and statuses, and a separate palette for categories and chart series. Keep category names and values visible and use distinct theme values for light and dark mode. The palette is scoped to statistics so other controls retain their default theme.

### Line and area charts

Keep all 14 examples in two Blocks collections. Each example uses the same native markup and canvas renderer in HTML, React, and Vue. Keep the sample series editable in the markup and use a labeled data table and keyboard inspection alongside the plot. Both collections use the theme-specific statistics palette. [ReUI line charts](https://v1.reui.io/blocks/charts/line-charts) and [ReUI area charts](https://v1.reui.io/blocks/charts/area-charts).

The docs example stage uses a 6% dot pattern in both themes. Keep it on the preview surface and omit it in forced colors.

### Live chart data

All chart examples can receive a replacement dataset after mount. HTML uses the foundation’s `setChartData` helper. React and Vue accept a `data` prop and bind it declaratively. Keep chart presentation configuration with the example and derive totals, legends, point readouts, tables, and CSV from the current dataset. Use stable series IDs to preserve metric selection when an update changes series order.
