39.0.0 • Published 2 years ago
@flowes/plate-toggle v39.0.0
Plate toggle plugin
This package implements the toggle plugin for Plate. It's similar to the indent list plugin, in that it relies on the indent of siblings.
Documentation
Check out Toggle.
Ideas to improve this plugin
- Adding an option
initialValueof opentoggleIdsand a callbackonChange, for instance to store the state of open toggles in local storage and remember the state upon browser refresh. - Adding an option
defaultOpen. Currently, toggles are closed on initial rendering. - Adding an option to specify how to get the indent value of elements, right now we are relying on this being the default
KEY_ELEMENTfrom theindentplugin - An option to specify how to get the id of elements, right now we are using the default id attribute from the
node-idplugin. - Adding a placeholder below the toggle, like Notion does, when the toggle is expanded without any elements below.
- Make toggle button more accessible
- When indenting an element right of a closed toggle, it becomes hidden. This makes sense, but a nicer UI would be to open the toggle in that case, like Notion does.