ToonUI
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()
  • ToonMessage
  • ToonRenderer
  • extractToonMarkdown()
  • getToonButtonProps()
  • getToonInputProps()
  • getToonTextareaProps()
  • getToonCheckboxProps()
  • basicPreset()
  • useToonAction()
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

LevelMeaning
minimalOnly the components you register
defaultBuilt-in defaults plus your overrides
strictFull 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.

Next step

  1. React Runtime and Hooks
  2. @toon-ui/toon-ui
  3. Package Architecture

On this page