-
-
Notifications
You must be signed in to change notification settings - Fork 755
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4340e94
commit 1d544bd
Showing
5 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
title: Context Menu | ||
description: Displays a menu to the user — such as a set of actions or functions — triggered by a button. | ||
component: true | ||
links: | ||
doc: https://www.radix-ui.com/docs/primitives/components/context-menu | ||
api: https://www.radix-ui.com/docs/primitives/components/context-menu#api-reference | ||
--- | ||
|
||
## Installation | ||
|
||
<Tabs defaultValue="cli"> | ||
|
||
<TabsList> | ||
<TabsTrigger value="cli">CLI</TabsTrigger> | ||
<TabsTrigger value="manual">Manual</TabsTrigger> | ||
</TabsList> | ||
<TabsContent value="cli"> | ||
|
||
```bash | ||
npx shadcn@latest add context-menu -r plate-ui | ||
``` | ||
|
||
</TabsContent> | ||
|
||
<TabsContent value="manual"> | ||
|
||
<Steps> | ||
|
||
<Step>Install the following dependencies:</Step> | ||
|
||
```bash | ||
npm install @radix-ui/react-context-menu | ||
``` | ||
|
||
<Step>Copy and paste the following code into your project.</Step> | ||
|
||
<ComponentSource src="../../templates/plate-playground-template/src/components/plate-ui/context-menu.tsx" /> | ||
|
||
<Step>Update the import paths to match your project setup.</Step> | ||
|
||
</Steps> | ||
|
||
</TabsContent> | ||
|
||
</Tabs> | ||
|
||
## Usage | ||
|
||
```tsx | ||
import { | ||
ContextMenu, | ||
ContextMenuContent, | ||
ContextMenuItem, | ||
ContextMenuTrigger, | ||
} from "@/components/ui/context-menu" | ||
``` | ||
|
||
```tsx | ||
<ContextMenu> | ||
<ContextMenuTrigger>Right click</ContextMenuTrigger> | ||
<ContextMenuContent> | ||
<ContextMenuItem>Profile</ContextMenuItem> | ||
<ContextMenuItem>Billing</ContextMenuItem> | ||
<ContextMenuItem>Team</ContextMenuItem> | ||
<ContextMenuItem>Subscription</ContextMenuItem> | ||
</ContextMenuContent> | ||
</ContextMenu> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters