Detail Drawer
Detail Drawer Component
Installation
Install the following dependencies:
Install the necessary dependencies using your preferred package manager:
Setup the detailDrawerStore
Create a new file called useDetailDrawerStore.ts in your store directory:
store/useDetailDrawerStore.ts
Adding shadcn/ui components
Once shadcn/ui is installed, you can add its components to your project using the following command:
Usage
Create a new file called page.tsx in your pages directory:
pages/page.tsx
Add the DetailDrawer component to your root layout:
Usage with Button
Create a new file called page.tsx in your pages directory:
pages/page.tsx
Composition
This component is a combination of two main components: DetailDrawer and DetailDrawerTrigger.
Sub Components
DetailDrawer- Main component for the drawerDetailDrawerTrigger- Trigger for opening the drawer
Props
Detail Drawer Props
| Name | Type | Default | Description |
|---|---|---|---|
className | string | "" | Additional classes for the detail drawer |
children | React.ReactNode | null | Content of the detail drawer |
Detail Drawer Trigger Props
| Name | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | null | Content of the detail drawer trigger |
className | string | "" | Additional classes for the detail drawer trigger |
content | React.ReactNode | null | Content of the detail drawer |