Extending
Custom components
Any React component can be used in a story. Declare a module in the configuration:
recit.config.ts
components/index.tsx
In a site, pass the same module in the publish section of recit.config.ts:
recit.config.ts
Live demo
Syntax
Markdown
MDX
Attributes and props
| Attribute | Type | Default | Description |
|---|---|---|---|
name | string | — | Exported name of the component (required) |
| any other | string | — | Passed as a prop (Markdown attributes are strings) |
React is provided by the engine. Style a component with a CSS module next to it
(Counter.module.css, imported as classes), or with the stylesheet of theme.customCss: utility
classes are not compiled.
In other formats
| Format | Status | Notes |
|---|---|---|
deck | Available | Rendered in slides, the presenter console and the HTML and PDF exports. |
docs | Available | Through <StoryEmbed slug="…" /> in any page of a site. |
motion | Available | Animated block in a film. |
report | Planned · P6 | Section of a paged report. |
toon | Planned · P7 | Panel of a vertical strip. |
book | Planned · P8 | Block of a printable chapter. |