snapshot of https://github.com/shadcn-ui/ui.git (main, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
40
apps/v4/examples/aria/drawer-snap-points.tsx
Normal file
40
apps/v4/examples/aria/drawer-snap-points.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
"use client"
|
||||
|
||||
import { Button } from "@/styles/aria-nova/ui/button"
|
||||
import {
|
||||
Drawer,
|
||||
DrawerClose,
|
||||
DrawerContent,
|
||||
DrawerDescription,
|
||||
DrawerFooter,
|
||||
DrawerHeader,
|
||||
DrawerTitle,
|
||||
DrawerTrigger,
|
||||
} from "@/styles/aria-nova/ui/drawer"
|
||||
|
||||
const SNAP_POINTS = ["31rem", 1]
|
||||
|
||||
export function DrawerSnapPoints() {
|
||||
return (
|
||||
<Drawer snapPoints={SNAP_POINTS} showSwipeHandle>
|
||||
<DrawerTrigger render={<Button variant="outline" />}>
|
||||
Open Snap Drawer
|
||||
</DrawerTrigger>
|
||||
<DrawerContent>
|
||||
<DrawerHeader>
|
||||
<DrawerTitle>Snap points</DrawerTitle>
|
||||
<DrawerDescription>
|
||||
Drag the drawer to snap between a compact peek and a near
|
||||
full-height view.
|
||||
</DrawerDescription>
|
||||
</DrawerHeader>
|
||||
<div className="flex-1 p-4">
|
||||
<div className="rounded-2xl bg-muted group-data-[swipe-axis=x]/drawer-popup:size-full group-data-[swipe-axis=y]/drawer-popup:h-80 group-data-[swipe-axis=y]/drawer-popup:w-full" />
|
||||
</div>
|
||||
<DrawerFooter>
|
||||
<DrawerClose render={<Button />}>Close</DrawerClose>
|
||||
</DrawerFooter>
|
||||
</DrawerContent>
|
||||
</Drawer>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user