diff --git a/docs/docs/CustomActions.mdx b/docs/docs/CustomActions.mdx new file mode 100644 index 00000000..d2e6cbc4 --- /dev/null +++ b/docs/docs/CustomActions.mdx @@ -0,0 +1,17 @@ +--- +sidebar_position: 5 +--- + +# Custom actions + +For more specific use case you can add custom buttons. + +```js +// Register a new button +editor.registerButton({ + position: 'header', // 'footer' or 'header' + icon: '', + action: () => alert('Hello world'), + title: 'Title' +}) +``` diff --git a/docs/docs/Fields/CustomField.md b/docs/docs/Fields/CustomField.md index c2a62912..b281cf2b 100644 --- a/docs/docs/Fields/CustomField.md +++ b/docs/docs/Fields/CustomField.md @@ -76,4 +76,18 @@ export const Number = defineField({ }) ``` -You can check how [it is used internally](https://github.com/boxraiser/visual-editor/tree/main/visual-editor/src/fields) +You can check how [it is used internally](https://github.com/ciklik/visual-editor/tree/main/visual-editor/src/fields) + +## UIKit + +The library exposes an object `UI` with some components used internally. You can use these components to keep a coherent design. + +```jsx +import { Field, defineField, React, UI } from '@boxraiser/visual-editor' + +const Component = ({ value, onChange, options }) => { + return