GitHub

Toggle

A two-state button that can be either on or off.

Docs

Installation

npx solidui-cli@latest add toggle

Usage

import { Toggle } from "~/components/ui/toggle"
<Toggle>
  {(state) => (
    <Show when={state.pressed()} fallback={<Icon2 />}>
      <Icon1 />
    </Show>
  )}
</Toggle>