BetaBeta pública — Consulta las notas de lanzamiento
Documentación

Switch

Ejemplo básico de switch demostrando el comportamiento principal.

Paquete
@solidiom/switch
Versión
0.0.1-next.0
Estado
stable

Ejemplos

import * as Switch from "@solidiom/switch"

;<Switch.Root>Contenido de Switch</Switch.Root>
Ver código fuente
        export function SwitchExample(props: SwitchExampleProps) {
  const copy = () => COPY[props.locale]
  const [on, setOn] = createSignal(false)

  return (
    <div ref={(el) => el.setAttribute("data-hydrated", "true")} class="switch-example">
      <Switch.Root checked={on} onCheckedChange={setOn}>
        {copy().label}
        <Switch.Thumb />
      </Switch.Root>
    </div>
  )
}