API Reference & Types
Complete typescript props, types, and configurations available in Tiptide.
Tiptide is designed to be highly typed and fully compatible with React. Below are the key types, properties, and configurations.
TextEditorProps (Props for <TiptideEditor /> & <TiptideProvider />)
| Prop | Type | Default | Description |
|---|---|---|---|
content | TiptideContentType | null | Initial editor content (HTML string or JSONContent). |
onChange | (editor: Editor) => void | undefined | Triggered on every keystroke/editor change. |
placeholder | string | "Start writing..." | Text shown when the editor canvas is empty. |
hideBubbleMenuOnTouch | boolean | true | Hides the floating bubble menu on mobile touch pointer devices. |
hideTooltip | boolean | false | Disable toolbar tooltips entirely. |
onUpload | (file: File) => Promise<string> | undefined | Async function returning URL to upload images locally or to CDN. |
imagePlaceholderBlock | React.ComponentType | undefined | Custom loader template when rendering dynamic image uploading state. |
onMount | (editor: Editor) => void | undefined | Fired when the underlying Tiptap editor mounts. |
Exported Types
TiptideContentType:string | JSONContent | nullTiptideEditorType: Direct alias of Tiptap's coreEditorclass.TiptideJSONContentType: Direct alias of Tiptap'sJSONContenttype structure.
Example
tsx
import {
type TiptideEditorType,
type TiptideContentType
} from 'tiptide';
// Example defining types in custom hooks or utility helpers
export function getWordCount(editor: TiptideEditorType): number {
return editor.storage.characterCount?.words() || 0;
}