Components
RichText
a components that wraps the webview that renders the editor
props:
name | type | default | description |
---|---|---|---|
editor | EditorBridge | The bridge instance that created with useEditorBridge |
you can also override any of the regular WebView props although this is not recommended
Toolbar
A react component of a basic Toolbar that include these features:
-
Add link context
-
Change headling context
-
A lot of pre made toolbar items:
- link
- quote
- code
- bold
- italic
- checkList
- underline
- strikethrough
- h1
- h2
- h3
- h4
- h5
- h6
- orderedList
- bulletList
- sync
- lift
- undo
- redo
props:
name | type | default | description |
---|---|---|---|
editor | EditorBridge | The bridge instance that created with useEditorBridge | |
hidden | boolean | a prop to control if toolbar shown | |
items | ToolbarItem[] | DEFAULT_TOOLBAR_ITEMS | array of ToolbarItem's that will be shown on the toolbar |
See how we add a custom toolbar item in the color keyboard example
ToolbarItem
The item rendered by the toolbar component
export interface ToolbarItem {
onPress: ({ editor, editorState }: ArgsToolbarCB) => () => void;
active: ({ editor, editorState }: ArgsToolbarCB) => boolean;
disabled: ({ editor, editorState }: ArgsToolbarCB) => boolean;
image: ({ editor, editorState }: ArgsToolbarCB) => any;
}
type ArgsToolbarCB = {
editor: EditorBridge;
editorState: BridgeState;
};