Installation
yarn add @poool/oak @poool/oak-react
Usage
import { useState } from 'react';
import { Builder } from '@poool/oak-react';
export default () => {
const [value, setValue] = useState([]);
const onChange = field => {
setValue(field.value);
};
return (
<Builder
onChange={onChange}
value={value}
/>
);
};
Documentation
<Builder />
Props
-
value
{Array
} the content you want your Builder to begin with. If you want to start with a empty Builder, pass an empty array. -
options
{Object
} (optional) the options you want to pass to the Builder. See options for more information. -
onChange
{Function
} (optional) the event listener which will be called when the Builder changes. See onChange event for more information. -
onImageUpload
{Function
} (optional) the event listener which will be called when an image is uploaded using theimage
field type. See onImageUpload event -
containerProps
{Object
} (optional) the props you want to pass to the Builder's inner container.
Contributing
Please check the CONTRIBUTING.md doc for contribution guidelines.
License
This software is licensed under MIT.