Switch
crenspire-glass-ui/switchFreeComponent
A control that allows the user to toggle between checked and not checked with optional glassy variant.
Live preview
live · rendered by the registry
Rendered by crenspire/glass-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://glass-ui.crenspire.com/r/switch.jsonSource
1"use client"23import * as React from "react"4import { Switch as BaseSwitch } from "@/components/ui/switch"5import { cn } from "@/lib/utils"67export interface SwitchProps extends React.ComponentProps<typeof BaseSwitch> {8 glow?: boolean9}1011/**12 * Glass UI Switch - Enhanced switch with glassy effects13 */14export const Switch = React.forwardRef<15 React.ElementRef<typeof BaseSwitch>,16 SwitchProps17>(({ className, variant = "glass", glow = false, ...props }, ref) => {18 return (19 <BaseSwitch20 ref={ref}21 variant={variant}22 className={cn(23 glow && "data-[state=checked]:shadow-lg data-[state=checked]:shadow-purple-500/30",24 "transition-all duration-200",25 className26 )}27 {...props}28 />29 )30})31Switch.displayName = "Switch"32
What it pulls in
npm packages
Other registry items
Files it writes
More from crenspire/glass-ui
All 49 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | crenspire/glass-ui | Components | Free | 2 deps · 5 files | |
| Alertalert | crenspire/glass-ui | Components | Free | no deps · 5 files | |
| Alert Dialogalert-dialog | crenspire/glass-ui | Components | Free | 1 dep · 5 files | |
| Avataravatar | crenspire/glass-ui | Components | Free | 1 dep · 5 files | |
| Badgebadge | crenspire/glass-ui | Components | Free | no deps · 5 files | |
| Breadcrumbbreadcrumb | crenspire/glass-ui | Components | Free | 2 deps · 5 files | |
| Buttonbutton | crenspire/glass-ui | Components | Free | 1 dep · 5 files | |
| Button Groupbutton-group | crenspire/glass-ui | Components | Free | no deps · 5 files |
