# Sliding Thumb Switch

https://fieldbook.lizardi.mx/components/sliding-thumb-switch

Category: Inputs
![Still of the Sliding Thumb Switch component, a Fieldbook UI component in Inputs.](https://fieldbook.lizardi.mx/thumbs/sliding-thumb-switch.webp)
Preview video: https://ejpqcxcjbiyabxkx.public.blob.vercel-storage.com/previews/sliding-thumb-switch-478a9f91a6.mp4 (5 s, silent)

Sliding Thumb Switch: An on/off switch built from a hidden checkbox: a pill track that recolors and a round thumb that slides to the opposite edge.

## Frameworks

react, vue, svelte, astro, html

## Preview controls

These controls are passed to the demo. Defaults and limits describe the preview; consult the implementation for its full prop API.

| Name | Type | Default | Options or constraints |
| --- | --- | --- | --- |
| checked | boolean | false | No additional limit in the metadata. |
| accentColor | color | #2F5FD0 | No additional limit in the metadata. |
| disabled | boolean | false | No additional limit in the metadata. |

## Usage notes

Sliding Thumb Switch uses the inline preview frame with a light/dark theme setting.

### Which frameworks are available for Sliding Thumb Switch?

Sliding Thumb Switch is available for React, Vue, Svelte, Astro, HTML. The live preview uses React; the source observations below apply to index.tsx. Check the selected port before relying on the same interactions.

### What does Sliding Thumb Switch depend on?

The React metadata lists these npm dependencies beyond React: motion, clsx.

### What accessibility details are visible in Sliding Thumb Switch?

The React source for Sliding Thumb Switch includes: native elements (input, label); attributes and handlers (aria-hidden, aria-label, onKeyDown); key comparisons (Enter). These are source observations. Verify accessible names, focus order and keyboard behavior in the composed page.

### How does Sliding Thumb Switch handle reduced motion?

Sliding Thumb Switch reads the motion preference in its React source through useReducedMotion(). Preference-dependent expressions in index.tsx: move: reduced ? \{ duration: 0 \} : \{ duration: 0.22, ease: \[0.4, 0, 0.2, 1\] \}; transitionDuration: reduced ? "0ms" : "220ms". Check the full implementation, shared styles and selected port with reduced motion enabled; these observations do not establish that every animation stops.

## Install through MCP

Connect your client, call get_component to retrieve the implementation, then get_install_command for installation instructions. Choose a listed framework, integrate the returned source and verify it in your application.

```json
{
  "tool": "get_component",
  "arguments": {
    "slug": "sliding-thumb-switch",
    "framework": "react"
  }
}
```

[For agents](https://fieldbook.lizardi.mx/docs/agents)
[MCP](https://fieldbook.lizardi.mx/api/mcp)

## Related open components

- [Icon crossfade switch](https://fieldbook.lizardi.mx/components/icon-crossfade-switch)
- [Latching square toggle](https://fieldbook.lizardi.mx/components/latching-square-toggle)
- [Settings Toggle Row](https://fieldbook.lizardi.mx/components/press-stretch-switch)
- [Spring layout toggle](https://fieldbook.lizardi.mx/components/spring-layout-toggle)
- [Addon Input Group](https://fieldbook.lizardi.mx/components/addon-input-group)
- [Auto Grow Textarea](https://fieldbook.lizardi.mx/components/auto-grow-textarea)
