Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Added description and example for Presets
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanbrud committed Mar 10, 2023
1 parent 46fa7fb commit c5cb89b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/components/inputs/ColorSelect2/Presets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@ export type Props = {
onColorClick: (color: string) => void;
};

/*
Presets is a UI for displaying color circles.
Example for changing the ColorSelect value using Presets:
const [color, setColor] = useState('#FFFFFF');
<ColorSelect2
label={
<div>
<ColorSelect2.Presets
onColorClick={(color) => {
setColor(color);
}}
/>
</div>
}
width={300}
height={150}
onChange={(color) => {
setColor(color);
}}
value={color}
/>
*/
export function Presets({ palette, label, onColorClick }: Props) {
const [index, indexSet] = useState(0);

Expand Down

0 comments on commit c5cb89b

Please sign in to comment.