# View mode toggle switch

https://fieldbook.lizardi.mx/components/view-mode-toggle-switch

Category: Navigation
![Still of the View mode toggle switch component, a Fieldbook UI component in Navigation.](https://fieldbook.lizardi.mx/thumbs/view-mode-toggle-switch.webp)
Preview video: https://ejpqcxcjbiyabxkx.public.blob.vercel-storage.com/previews/view-mode-toggle-switch-bff86192a0.mp4 (5 s, silent)

View mode toggle switch: A two-state switch that flips a view between two named modes, with a sliding thumb that shrinks under a press and swaps a small icon inside it.

## 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. |
| onLabel | text | Grid | Up to 16 characters |
| offLabel | text | List | Up to 16 characters |
| accent | color | #38BDF8 | No additional limit in the metadata. |

## Usage notes

View mode toggle switch uses the inline preview frame with a light/dark theme setting.

### Which frameworks are available for View mode toggle switch?

View mode toggle 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 View mode toggle switch depend on?

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

### What accessibility details are visible in View mode toggle switch?

The React source for View mode toggle switch includes: attributes and handlers (aria-checked, aria-hidden, aria-label); explicit roles (switch). These are source observations. Verify accessible names, focus order and keyboard behavior in the composed page.

### How does View mode toggle switch handle reduced motion?

View mode toggle switch reads the motion preference in its React source through useReducedMotion(). Preference-dependent expressions in index.tsx: duration: reduceMotion ? 0 : 0.14; duration: reduceMotion ? 0 : 0.18; spring: reduceMotion ? \{ duration: 0 \} : \{ type: "spring" as const, stiffness: 560, damping: 34 \}. 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": "view-mode-toggle-switch",
    "framework": "react"
  }
}
```

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

## Related open components

- [Bubble burst menu](https://fieldbook.lizardi.mx/components/bubble-burst-menu)
- [Panel Tab Switcher](https://fieldbook.lizardi.mx/components/panel-tab-switcher)
- [Auto height tabs](https://fieldbook.lizardi.mx/components/auto-height-tabs)
- [Card blur tabs](https://fieldbook.lizardi.mx/components/card-blur-tabs)
- [Chameleon pill navbar](https://fieldbook.lizardi.mx/components/chameleon-pill-navbar)
- [Dock menu](https://fieldbook.lizardi.mx/components/dock-menu)
