wpColorPicker available in
color-picker.min.js, I was able to easily create color fields which simply display the color:
When you click the field, a color picker appears:
Now I want to do the same with Gutenberg components. However, I cannot find the exact replacement for
@wordpress/componentsis the picker itself, where the user is invited to choose a color. It doesn't seem to implement the "show" state. It's not a full-fledged form control.
@wordpress/componentsonly shows a color.
@wordpress/componentsdoes too much. Using the palette with an empty color set does not work either, it was not designed for this use case.
@wordpress/block-editorare even higher level.
- Using the Storybook's stories of the Gutenberg project, I can see that the latest
ColorPalettedoes what I'm looking for, but it doesn't behave that way in WordPress 5.8.1.
There is an obvious way to get the job done: write a
ColorControl component based on
Dropdown, or simply steal from the latest
But I'm wondering if a ready-to-use component is already available.