ThemeEditor is the wrapper for the ThemeEditorButton and ThemeEditorDrawer components.
It manages the open/closed states of the drawer and it provides the "HyperTheme Editor Chakra UI theme" (click here to see it on NPM) used by the editor itself.
View source
if you want to create a custom theme editor without breaking the editor UI itself, you have to use this component.
@hypertheme-editor/chakra-ui-core leads to a known issue with recoil.@hypertheme-editor/chakra-ui or @hypertheme-editor-pro/chakra-ui.import { ThemeEditor } from '@hypertheme-editor/chakra-ui'
import { ThemeEditor } from '@hypertheme-editor-pro/chakra-ui'
The ThemeEditor component is used to build custom theme editors that uses ThemeEditorDrawer and ThemeEditorButton components.
In this example you see a minimal custom MyThemeEditor with an empty ThemeEditorDrawer and the default ThemeEditorButton.
You should see that the drawer is opening and closing correctly.
The ThemeEditor component uses the useDisclosureProps() hook from Chakra UI and it accepts all the: UseDisclosureProps props.
So, you can control the open/closed state of the drawer by passing the isOpen prop.
| Name | Type | Default | Short Description |
|---|---|---|---|
children | ThemeEditorButton | ThemeEditorDrawer | undefined | components that need to be used for the ThemeEditor |
This component accepts also UseDisclosureProps from the Chakra UI useDisclosure() hook, read more here.
The ThemeEditor component pass the isOpen, onOpen and onClose props to its children.
Children must be of type ThemeEditorDrawer or ThemeEditorButton.
Prev
Next