You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One thing to add either in here or in another PR at some point: onChange example. Here's what I roughed out on the Vite page to make sure the thing worked as I expected:
import{useState}from"react";import{Switch}from"@/components";exportdefaultfunctionSwitchPage(){const[isSelected,setIsSelected]=useState(false);return(<><h2>Switch</h2><divstyle={{display: "flex",flexDirection: "column",gap: "var(--layout-margin-medium",}}><Switch>Label</Switch><SwitchlabelPosition="left">Reversed label position</Switch><SwitchisDisabled>Disabled switch</Switch><SwitchlabelPosition="left"defaultSelected>
Switch on by default
</Switch><div><Switchid="controlled-switch"isSelected={isSelected}onChange={()=>setIsSelected(!isSelected)}><pre>isSelected:</pre>{isSelected ? "true" : "false"}</Switch></div></div></>);}
One thing to add either in here or in another PR at some point:
onChange
example. Here's what I roughed out on the Vite page to make sure the thing worked as I expected:Originally posted by @ty2k in #440 (review)
The text was updated successfully, but these errors were encountered: