Slide 86
Slide 86 text
React A11y & TailwindCSS
let { buttonProps, isPressed } = useButton(props, ref)
;
let { focusProps, isFocusVisible } = useFocusRing()
;
let className = classNames
(
props.isDisabled ? "bg-gray-400" : isPressed ? "bg-blue-700" : "bg-blue-500"
,
"text-white", "font-bold"
,
"py-2", "px-4"
,
"rounded"
,
"cursor-default"
,
"focus:outline-none"
,
isFocusVisible ? "shadow-outline" : ""
,
"transition", "ease-in-out", "duration-150
"
);