Skip to main content

useColorByKey

The useColorByKey hook can be used in your components to resolve a color value, given a PaletteKey.

const Button: FC<{ color: PaletteKey }> = ({ color }) => {
const background = useColorByKey(color);

return <Box as="button" background={background} />
}