The minimum to get a working reactolith app is:
Any tag name with a hyphen (e.g. <my-button>) is
treated as a custom React component and resolved through the function
you pass to new App(...). Everything else
(<h1>, <div>,
<svg>, …) is rendered as a native HTML
element.
For larger apps — including drop-in shadcn directories —
createLoader resolves tag names to a folder of files
without any per-component setup:
<ui-button> →
./components/ui/button.tsx (named export
Button or default). Names with multiple
kebab segments fall back to a parent file —
<ui-accordion-item> finds
accordion.tsx and picks its AccordionItem
export.
To layer custom components on top of shadcn (or any other base set), pass multiple module maps; earlier maps take priority:
createLoader options| Option | Type | Description |
|---|---|---|
modules | ModuleMap or ModuleMap[] | Output of import.meta.glob. Earlier maps take priority. |
prefix | string | Prefix to strip from is before resolving (e.g. "ui-"). |
fallback | ReactNode | Rendered while a component is being lazy-loaded. Default null. |
onMissing | (name, is) => ComponentType | null | Called when no module resolves; return a placeholder to render in its place. |
Continue with How It Works to learn how reactolith hydrates and updates your app.