Skip to main content
Version: v1 (Current)

Adding a public component

Start with the current library patterns and Reka UI APIs. Use the existing primitives rather than replacing their keyboard/focus behavior with custom controls. Any scaffold copied from another library/version needs adaptation to AppUI's current imports, CSS tokens and platform contract.

Implementation​

  1. Add the component under the appropriate ui/domain/forms/experience directory.
  2. Declare props, events and useful named/scoped slots. Export public data/configuration types.
  3. Use semantic classes such as bg-card/text-card-foreground/border-border and accept a class override. Platform variables are complete CSS colors, not HSL channel tuples.
  4. Add a directory index and named root export. Experience pages should also be exported from the experience barrel, with explicit default action/result metadata when needed.
  5. Add an authored Storybook example with valid defaults for required props. Show consequential loading/error/empty/disabled states and how emitted events are handled.
  6. Verify consequential behavior, regenerate the public references, and run the package/Storybook checks.

Tailwind configuration lives in src/styles/tailwind.css using CSS-first @theme, @utility and layered rules. There is no Tailwind v3 configuration file to extend. Preserve underscored platform variables and map them into readable semantic utility tokens.

Auto-portaled surfaces use the nearest ThemeWrapper's injected target. Expose portalTo/disablePortal when wrapping a new portaled surface and keep those options out of the underlying content props. Use the current Dialog/Popover implementations as examples.

Examples and discovery​

Storybook metadata should name the public component and include practical compositions. Companion parts can appear in their parent's story: the catalog extracts those compositions without executing modules. Helpers should have a complete source demo or example file, rewritten to public imports in the generated guide.

The metadata extractor enumerates actual public exports. Do not invent unexported component names or manually maintain a separate catalog. pnpm docs:generate writes the public API reference and experience-page defaults from the same contracts used by the AI manifests.

See verification commands, component recipes, and flow recipes.