This component no longer exists. It was in ondo-ui’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-09 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
drawer
ondo-ui/drawerRemovedComponent
A drawer component for React.
Install it
npx shadcn@latest add https://ui.ondo.dou.so/r/drawer.jsonSource
1"use client"23import * as React from "react"4import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer"56import { cn } from "@/lib/utils"78type DrawerContextProps = {9 hasSnapPoints: boolean10 modal: DrawerPrimitive.Root.Props["modal"]11 showSwipeHandle: boolean12 swipeDirection: NonNullable<DrawerPrimitive.Root.Props["swipeDirection"]>13}1415const DrawerContext = React.createContext<DrawerContextProps | null>(null)1617function useDrawer() {18 const context = React.useContext(DrawerContext)1920 if (!context) {21 throw new Error("useDrawer must be used within a Drawer.")22 }2324 return context25}2627function Drawer({28 modal = true,29 showSwipeHandle = false,30 snapPoints,31 swipeDirection = "down",32 ...props33}: DrawerPrimitive.Root.Props & {34 showSwipeHandle?: boolean35}) {36 const hasSnapPoints = snapPoints != null && snapPoints.length > 037 const contextValue = React.useMemo(38 () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),39 [hasSnapPoints, modal, showSwipeHandle, swipeDirection]40 )4142 return (43 <DrawerContext.Provider value={contextValue}>44 <DrawerPrimitive.Root45 data-slot="drawer"46 modal={modal}47 snapPoints={snapPoints}48 swipeDirection={swipeDirection}49 {...props}50 />51 </DrawerContext.Provider>52 )53}5455function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {56 return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />57}5859function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {60 return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />61}6263function DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {64 return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />65}6667function DrawerOverlay({68 className,69 ...props70}: DrawerPrimitive.Backdrop.Props) {71 return (72 <DrawerPrimitive.Backdrop73 data-slot="drawer-overlay"74 className={cn(75 "fixed inset-0 z-50 min-h-dvh bg-black/10 opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-0 supports-backdrop-filter:backdrop-blur-xs supports-[-webkit-touch-callout:none]:absolute",76 className77 )}78// … truncated
What it pulls in
npm packages
Other registry items
