Glass Sheet
washiveil/glass-sheetFreeComponent
Side sheet as a veil — slides from any edge over a soft scrim. Built on Radix Dialog.
Install it
npx shadcn@latest add https://washiveil.alexchih.com/r/glass-sheet.jsonSource
1'use client'23import * as React from 'react'4import { Dialog as DialogPrimitive } from 'radix-ui'5import { X } from 'lucide-react'6import { cva, type VariantProps } from 'class-variance-authority'78import { cn } from '@/lib/utils'910const GlassSheet = DialogPrimitive.Root1112const GlassSheetTrigger = DialogPrimitive.Trigger1314const GlassSheetClose = DialogPrimitive.Close1516const GlassSheetPortal = DialogPrimitive.Portal1718const GlassSheetOverlay = React.forwardRef<19 React.ComponentRef<typeof DialogPrimitive.Overlay>,20 React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>21>(({ className, ...props }, ref) => (22 <DialogPrimitive.Overlay23 ref={ref}24 className={cn(25 'fixed inset-0 z-50 bg-deep/20 backdrop-blur-sm dark:bg-black/40 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',26 className,27 )}28 {...props}29 />30))31GlassSheetOverlay.displayName = DialogPrimitive.Overlay.displayName3233const glassSheetContentVariants = cva(34 'fixed z-50 gap-4 bg-glass-stronger backdrop-blur-2xl backdrop-saturate-150 p-6 shadow-[0_16px_48px_rgba(28,25,20,0.12)] transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:duration-300 data-[state=closed]:duration-200',35 {36 variants: {37 side: {38 top: 'inset-x-2 top-2 rounded-3xl border border-glass-edge data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',39 bottom:40 'inset-x-2 bottom-2 rounded-3xl border border-glass-edge data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',41 left: 'inset-y-2 left-2 h-auto w-3/4 max-w-sm rounded-3xl border border-glass-edge data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left',42 right:43 'inset-y-2 right-2 h-auto w-3/4 max-w-sm rounded-3xl border border-glass-edge data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right',44 },45 },46 defaultVariants: {47 side: 'right',48 },49 },50)5152export interface GlassSheetContentProps53 extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,54 VariantProps<typeof glassSheetContentVariants> {}5556const GlassSheetContent = React.forwardRef<57 React.ComponentRef<typeof DialogPrimitive.Content>,58 GlassSheetContentProps59>(({ side = 'right', className, children, ...props }, ref) => (60 <GlassSheetPortal>61 <GlassSheetOverlay />62 <DialogPrimitive.Content63// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from washiveil
All 58 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Ambient Fieldambient-field | washiveil | Components | Free | no deps | |
| Chipchip | washiveil | Components | Free | 1 dep | |
| Code Badgecode-badge | washiveil | Components | Free | no deps | |
| Glass Accordionglass-accordion | washiveil | Components | Free | 2 deps | |
| Glass Alertglass-alert | washiveil | Components | Free | 1 dep | |
| Glass Alert Dialogglass-alert-dialog | washiveil | Components | Free | 1 dep | |
| Glass Aspect Ratioglass-aspect-ratio | washiveil | Components | Free | 1 dep | |
| Glass Avatarglass-avatar | washiveil | Components | Free | 1 dep |
