Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfeng33 committed Oct 26, 2024
1 parent 4340e94 commit 1d544bd
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/www/content/docs/components/block-context-menu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Install the following dependencies:
```bash
npm install @radix-ui/react-context-menu
```
- [ContextMenu](/docs/components/context-menu)
- [BlockSelection](/docs/block-selection)
- [BlockMenu](/docs/block-menu)

Expand Down
69 changes: 69 additions & 0 deletions apps/www/content/docs/components/context-menu.mdx
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>
```
7 changes: 6 additions & 1 deletion apps/www/content/docs/components/slash-input-element.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ npx @udecode/plate-ui@latest add slash-input-element -r plate-ui

Install the following dependencies:

- [SlashCommand](/docs/slash-command)
- [Combobox](/docs/combobox)
- [Slash Command](/docs/slash-command)
- [InlineCombobox](/docs/components/inline-combobox)

</Step>

Expand All @@ -44,6 +46,7 @@ Copy and paste the following code into your project.
</Step>

<ComponentSource src="../../templates/plate-playground-template/src/components/plate-ui/slash-input-element.tsx" />
<ComponentSource src="../../templates/plate-playground-template/src/components/plate-ui/inline-combobox.tsx" />

<Step>

Expand All @@ -62,6 +65,8 @@ Update the import paths to match your project setup.
<ComponentPreview name="playground-demo" id="slashCommand" />

<ComponentSource src="../../templates/plate-playground-template/src/components/plate-ui/slash-input-element.tsx" />
<ComponentSource src="../../templates/plate-playground-template/src/components/plate-ui/inline-combobox.tsx" />


## Plate Plus

Expand Down
4 changes: 4 additions & 0 deletions apps/www/src/config/customizer-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export const customizerComponents = {
href: '/docs/components/comments-popover',
title: 'Comments Popover',
},
contextMenu: {
href: '/docs/components/context-menu',
title: 'Context Menu',
},
cursorOverlay: {
href: '/docs/components/cursor-overlay',
title: 'Cursor Overlay',
Expand Down
1 change: 1 addition & 0 deletions apps/www/src/config/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const docsConfig: DocsConfig = {
customizerComponents.codeLineElement,
customizerComponents.codeSyntaxLeaf,
customizerComponents.colorDropdownMenu,
customizerComponents.contextMenu,
customizerComponents.command,
customizerComponents.commentLeaf,
customizerComponents.commentToolbarButton,
Expand Down

0 comments on commit 1d544bd

Please sign in to comment.