mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 01:45:10 +03:00
* docs updates * docs expansion * minor docs fix * improvements * fix dependencies * docs expansion * more table examples * map over data * improve copy * Update apps/design-system/registry/default/example/table-row-link-actions.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update apps/design-system/registry/default/example/table-row-link-actions.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fixes * fix --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
90 lines
1.8 KiB
Plaintext
90 lines
1.8 KiB
Plaintext
---
|
|
title: Dropdown Menu
|
|
description: Displays a menu to the user — such as a set of actions or functions — triggered by a button.
|
|
featured: true
|
|
component: true
|
|
links:
|
|
doc: https://www.radix-ui.com/docs/primitives/components/dropdown-menu
|
|
api: https://www.radix-ui.com/docs/primitives/components/dropdown-menu#api-reference
|
|
source:
|
|
radix: true
|
|
shadcn: true
|
|
---
|
|
|
|
<ComponentPreview name="dropdown-menu-demo" peekCode wide />
|
|
|
|
## Installation
|
|
|
|
<Tabs defaultValue="cli">
|
|
|
|
<TabsList>
|
|
<TabsTrigger value="cli">CLI</TabsTrigger>
|
|
<TabsTrigger value="manual">Manual</TabsTrigger>
|
|
</TabsList>
|
|
<TabsContent value="cli">
|
|
|
|
```bash
|
|
npx shadcn-ui@latest add dropdown-menu
|
|
```
|
|
|
|
</TabsContent>
|
|
|
|
<TabsContent value="manual">
|
|
|
|
<Steps>
|
|
|
|
<Step>Install the following dependencies:</Step>
|
|
|
|
```bash
|
|
npm install @radix-ui/react-dropdown-menu
|
|
```
|
|
|
|
<Step>Copy and paste the following code into your project.</Step>
|
|
|
|
{/* <ComponentSource name="dropdown-menu" /> */}
|
|
|
|
<Step>Update the import paths to match your project setup.</Step>
|
|
|
|
</Steps>
|
|
|
|
</TabsContent>
|
|
|
|
</Tabs>
|
|
|
|
## Usage
|
|
|
|
```tsx
|
|
import {
|
|
DropdownMenu,
|
|
DropdownMenuContent,
|
|
DropdownMenuItem,
|
|
DropdownMenuLabel,
|
|
DropdownMenuSeparator,
|
|
DropdownMenuTrigger,
|
|
} from '@/components/ui/dropdown-menu'
|
|
```
|
|
|
|
```tsx
|
|
<DropdownMenu>
|
|
<DropdownMenuTrigger>Open</DropdownMenuTrigger>
|
|
<DropdownMenuContent>
|
|
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
|
<DropdownMenuSeparator />
|
|
<DropdownMenuItem>Profile</DropdownMenuItem>
|
|
<DropdownMenuItem>Billing</DropdownMenuItem>
|
|
<DropdownMenuItem>Team</DropdownMenuItem>
|
|
<DropdownMenuItem>Subscription</DropdownMenuItem>
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
```
|
|
|
|
## Examples
|
|
|
|
### Checkboxes
|
|
|
|
<ComponentPreview name="dropdown-menu-checkboxes" />
|
|
|
|
### Radio Group
|
|
|
|
<ComponentPreview name="dropdown-menu-radio-group" />
|