diff --git a/src/Switch.stories.tsx b/src/Switch.stories.tsx index b388d9a..413e4cb 100644 --- a/src/Switch.stories.tsx +++ b/src/Switch.stories.tsx @@ -24,6 +24,18 @@ export const Disabled = () => { ) } +export const DisabledActive = () => { + const [isChecked, setIsChecked] = useState(true) + return ( + setIsChecked(newValue)} + /> + ) +} + export const Sizes = () => { const [isChecked1, setIsChecked1] = useState(false) const [isChecked2, setIsChecked2] = useState(false) diff --git a/src/Switch.tsx b/src/Switch.tsx index 5425b76..676e608 100644 --- a/src/Switch.tsx +++ b/src/Switch.tsx @@ -96,6 +96,7 @@ export function Switch({ 'relative rounded-full border-0 bg-uzh-grey-80', disabled && 'cursor-not-allowed bg-uzh-grey-40', checked && 'bg-primary-60', + checked && disabled && 'bg-primary-20', rootSize[size || 'md'], className?.element )}