UNPKG

@neynar/ui

Version:

React UI component library built on shadcn/ui and Tailwind CSS

53 lines (43 loc) 1.11 kB
# DrawerClose **Type**: component DrawerClose - Interactive element that closes the drawer Trigger element that closes the drawer when activated. Can be placed anywhere within the drawer content. By default renders as a button but can be composed with other elements using asChild. Multiple close triggers can exist within a single drawer. ## JSX Usage ```jsx import { DrawerClose } from '@neynar/ui'; <DrawerClose asChild={true} > {/* Your content here */} </DrawerClose> ``` ## Component Props ### asChild - **Type**: `boolean` - **Required**: No - **Description**: No description available ### children - **Type**: `React.ReactNode` - **Required**: No - **Description**: No description available ## Examples ### Example 1 ```tsx // Default close button <DrawerClose>Close</DrawerClose> ``` ### Example 2 ```tsx // Composed with custom button <DrawerClose asChild> <Button variant="ghost">Cancel</Button> </DrawerClose> ``` ### Example 3 ```tsx // Icon-only close button <DrawerClose asChild> <Button size="icon" variant="ghost"> <X className="h-4 w-4" /> </Button> </DrawerClose> ```