Measured entry
hextaui-switch
A client-side React toggle built as a thin styled wrapper around Radix Switch. It ships as a shadcn registry item and relies on Tailwind utility classes, project theme tokens, and a cn helper backed by clsx and tailwind-merge.



Measured
Every value below was written by the harness on the run that produced the frames above. None of it is derived from the prose.
| Build | OK |
|---|---|
| Mount | OK |
| Console errors | 0 |
| Uncaught page errors | 0 |
| Horizontal overflow | flagged at 375 |
| Axe critical | 0 |
| Axe serious | 0 |
| Axe moderate | 0 |
| Axe minor | 0 |
| Gzip marginal | 34.5 KB (100.0 KB build, 65.5 KB baseline) |
| Bare mode | OK |
| Provider required | NO |
| Demo used | written from the component source API |
Verdict
A solid minimal switch for an existing Radix and Tailwind stack. It builds and mounts cleanly, and the control has no detected accessibility violations. The narrow-screen overflow is caused by the fixed-width demo wrapper, not the switch itself.
Use it if
- You need a compact controlled or uncontrolled switch with disabled and focus states already wired.
- Your interface already uses Radix primitives and shadcn-style theme tokens.
- You want a small control that accepts the underlying Radix Switch props without another abstraction layer.
Skip it if
- You need a dependency-free control based on a native checkbox.
- Your project does not use Tailwind or shadcn-style color tokens and you do not want to translate its styling.
- You need a complete settings-field component that bundles its own label, description, validation, and layout.
Install
| Declared dependencies | @radix-ui/react-switch, clsx, tailwind-merge |
|---|---|
| Missing on install | none |
| Bare install | builds and mounts without the shadcn-style helpers |
| Provider | no provider required in the harness |
In a non-shadcn project, add React, Radix Switch, Tailwind, the required theme tokens, and a cn helper using clsx with tailwind-merge. Replace the project alias import if your resolver does not map it to the utility file.
Source and credit
This page is a review, not a copy. The component source lives with its author and this site does not republish it. Read the license before you use anything.
Author repository
github.com/preetsuthar17/HextaUIAlternatives
Other published entries for the switch pattern, ordered by what they measured: mounts first, then clean axe scans, then bare-mode passes, then the smaller bundle.
- neu-toggleneumorphism
- Renders
- YES
- A11y
- 0
- Gzip
- 17.8KB
- Bare
- pass
- Prov
- NO
- clay-toggleclaymorphism
- Renders
- YES
- A11y
- 0
- Gzip
- 18.2KB
- Bare
- pass
- Prov
- NO
- ruixen-scrub-datetimeunclassified
- Renders
- YES
- A11y
- 0
- Gzip
- 22.2KB
- Bare
- pass
- Prov
- NO
- shadcn-switchunclassified
- Renders
- YES
- A11y
- 0
- Gzip
- 34.4KB
- Bare
- pass
- Prov
- NO
- hextaui-tabsminimal-flat
- Renders
- YES
- A11y
- 0
- Gzip
- 39.0KB
- Bare
- pass
- Prov
- NO
- ruixen-animated-theme-togglerunclassified
- Renders
- YES
- A11y
- 0
- Gzip
- 61.8KB
- Bare
- pass
- Prov
- NO