Packages
@toon-ui/react
The explicit React integration layer for teams that want full ownership of rendering and adapters.
@toon-ui/react is the package for teams that want control, not just convenience.
Use it when the UI layer matters enough that defaults are not enough.
Why use @toon-ui/react?
Use it when you want:
- explicit adapter ownership
- custom component mapping
- design-system integration
- stricter rendering guarantees
What it owns
- React rendering runtime
- adapter creation
- adapter coverage metadata
- preset merging
- helper props for custom controls
Core APIs
createToonReactAdapter()createToonReactRuntime()ToonMessageToonRendererextractToonMarkdown()getToonButtonProps()getToonInputProps()getToonTextareaProps()getToonCheckboxProps()basicPreset()useToonAction()
Recommended starting pattern
import {
createToonReactAdapter,
createToonReactRuntime,
getToonButtonProps,
type ToonButtonComponentProps,
} from '@toon-ui/react';
function MyButton(props: ToonButtonComponentProps) {
return <button {...getToonButtonProps(props)}>{props.node.label}</button>;
}
const adapter = createToonReactAdapter({
level: 'default',
components: {
button: MyButton,
},
});
const runtime = createToonReactRuntime({ adapter });Adapter levels
| Level | Meaning |
|---|---|
minimal | Only the components you register |
default | Built-in defaults plus your overrides |
strict | Full coverage required or the runtime throws |
When strict matters
Use strict when your team wants hard guarantees that every semantic node is intentionally owned.
That is especially useful when:
- you have a mature design system
- visual consistency matters a lot
- fallback rendering is not acceptable
Why the helper props matter
The getToon*Props() helpers preserve correct behavior for custom components.
That means your custom button or field still gets:
- normalized values
- click handling
- submit wiring
- disabled-state behavior
Without those helpers, teams often rebuild behavior inconsistently.
Decision rule
Choose @toon-ui/react if your priority is:
- control first
- explicit rendering ownership
- long-term integration depth
Choose @toon-ui/toon-ui if your priority is speed.