function Example() {
const pressed = useKeyPress('s', { preventDefault: true, modifiers: { meta: true } });
return (
<Flex
alignItems="items-center"
backgroundColor={pressed ? 'bg-green-500' : 'bg-red-500'}
textColor="text-white"
transitionProperty="transition-all"
transitionDuration="duration-200"
borderRadius="rounded"
margin="mt-4"
padding={['px-4', 'py-2']}
>
<Icon name={pressed ? 'check' : 'close'} margin="mr-3" />
<Text as="kbd">⌘</Text>
<Text margin="mx-1">+</Text>
<Text as="kbd">s</Text>
<Text margin="ml-2"> are {pressed ? 'pressed' : 'not pressed'}</Text>
</Flex>
);
}