sanity-color-picker
v1.0.7
Published
A custom input component for displaying an array of color to pick from.
Downloads
10
Maintainers
Readme
Sanity Color Picker
Display colors for editors to choose from with this custom input component.
Installation
npm install sanity-color-picker
- In your schema:
import ColorPicker from "sanity-color-picker/lib";
export default {
title: "Color Picker",
name: "colorpicker",
type: "string",
inputComponent: ColorPicker,
options: {
list: [
{ title: "Yellow", value: "#f5c701" },
{ title: "Pink", value: "#f6cedb" },
{ title: "Red", value: "#f16d70" },
{ title: "Teal", value: "#88c6db" },
{ title: "Purple", value: "#aca0cc" },
{ title: "Green", value: "#bdcdcb" },
{ title: "White", value: "#fff" }
]
}
};
- Profit. The component returns the selected value.