7900 shaares
161 private links
161 private links
aria-label
and aria-labelledby
are exclusive. So they can be enforced for components in typescript:
type ToggleSwitchProps = {
name: string;
checked: boolean;
handleToggle: () => void;
size?: "sm" | "lg" | "base";
classNames?: string;
} & ({ ariaLabel: string; ariaLabelledBy: never } | { ariaLabel: never; ariaLabelledBy: string });