saveToDatabase(md)}
/>
);
}
```
### Collaboration Config
```tsx
interface CollaborationConfig {
sharedType: Y.XmlText;
awareness: Awareness;
user: { name: string; color: string };
}
```
When `collaboration` is provided, the Yjs document becomes the source of truth. The `content` prop only seeds an empty document.
### Providers
- y-websocket — WebSocket sync (self-hosted)
- y-webrtc — Peer-to-peer (no server)
- Liveblocks — Managed infrastructure
## Styling
Inkwell applies CSS classes to every element but ships no default styles.
### Editor CSS Classes
Container:
- `.inkwell-editor-wrapper` — Outer wrapper
- `.inkwell-editor` — Contenteditable area
Block elements:
- `.inkwell-editor-heading` + `.inkwell-editor-heading-1` through `-heading-6`
- `.inkwell-editor-blockquote`
- `.inkwell-editor-list-item`
- `.inkwell-editor-code-fence`
- `.inkwell-editor-code-line`
Syntax markers:
- `.inkwell-editor-marker`
- `.inkwell-editor-backtick`
Remote cursors:
- `.inkwell-editor-remote-cursor` — Selection highlight
- `.inkwell-editor-remote-caret` — Cursor position
### Renderer CSS Classes
- `.inkwell-renderer` — Wrapper div
- `.inkwell-renderer-code-block` — Wrapper around each `` (when `copyButton` enabled)
- `.inkwell-renderer-copy-btn` — Copy button on code blocks (appears on hover)
- Standard HTML elements inside: `h1`–`h6`, `p`, `blockquote`, `ul`, `ol`, `li`, `pre`, `code`, `a`, `strong`, `em`, `del`, `hr`, `table`, `img`
### Plugin CSS Classes
Bubble menu:
- `.inkwell-plugin-bubble-menu-container`
- `.inkwell-plugin-bubble-menu-inner`
- `.inkwell-plugin-bubble-menu-btn`
- `.inkwell-plugin-bubble-menu-item-bold`
- `.inkwell-plugin-bubble-menu-item-italic`
- `.inkwell-plugin-bubble-menu-item-strike`
Snippets:
- `.inkwell-plugin-snippets-popup`
- `.inkwell-plugin-snippets-picker`
- `.inkwell-plugin-snippets-search`
- `.inkwell-plugin-snippets-item`
- `.inkwell-plugin-snippets-item-active`
- `.inkwell-plugin-snippets-title`
- `.inkwell-plugin-snippets-preview`
- `.inkwell-plugin-snippets-empty`
## Exports
All public exports from `@railway/inkwell`:
Components:
- `InkwellEditor`
- `InkwellRenderer`
Plugin creators:
- `createBubbleMenuPlugin`
- `createSnippetsPlugin`
Plugin utilities:
- `defaultBubbleMenuItems`
- `pluginClass`
Serialization:
- `serializeToMarkdown(html: string): string`
- `parseMarkdown(markdown: string, components?, rehypePlugins?): ReactNode`
- `deserialize(markdown: string, decorations?): InkwellElement[]`
Types:
- `InkwellEditorProps`
- `InkwellRendererProps`
- `InkwellPlugin`
- `InkwellDecorations`
- `InkwellComponents`
- `BubbleMenuItem`
- `BubbleMenuItemProps`
- `CollaborationConfig`
- `PluginKeyDownContext`
- `PluginRenderProps`
- `PluginTrigger`
- `RehypePluginConfig`
- `Snippet`