agents/DEMOS.md
Tiptap uses demos for manual verification, end-to-end testing & as a playground for development.
demos/ repository.demos/src directory.demos/src/<Category>/<DemoName>/<Variant>.
<Category> is a broad grouping (e.g., "Commands", "Extensions", "Integrations").
demos/src/Commands/Formatting/Bold Command/React.<DemoName> is a specific feature or use case (e.g., "Bold Command", "Collaboration Extension", "React Integration").<Variant> is the framework variant (e.g., "React", "Vue", "Svelte") or "Vanilla" for framework-agnostic demos.index.html file to be recognized by vite's filesystem-based routing.demos/setupindex.tsx/index.vue.
demos/setup/style.scss are available globally in all demo stylesheets.demos/setup/style.scss
:root element includes CSS variables for colors, spacing, and other design tokens. Read demos/setup/style.scss[2-21] for details on available variables..tiptap class should not be used as it is for the editor content area..button-group class on a container element around the buttons..button-group and other controls in a .control-group element. You can make it sticky by adding .sticky to the .control-group..output-group is a container for demo outputs (e.g., editor content, logs). It has a default style with a light background and padding.@tiptap/* importsWe use the demos tsconfig.json to alias imports from @tiptap/* to the local packages src directories. This allows us to test the actual published package APIs in the demos, without needing to build and publish them first. When adding a demo, make sure to import from @tiptap/core, @tiptap/react, etc., instead of relative paths.
Start in dev mode:
pnpm dev
Build static output and serve locally:
pnpm serve