mirror of
https://github.com/huntabyte/shadcn-svelte.git
synced 2026-09-14 19:33:46 +08:00
7ff65b4892
Co-authored-by: Crush <crush@charm.land> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1.8 KiB
1.8 KiB
title, description, component, links
| title | description | component | links |
|---|---|---|---|
| Context Menu | Displays a menu to the user — such as a set of actions or functions — triggered by right click. | true |
Installation
{#snippet cli()} {/snippet} {#snippet manual()}Install bits-ui:
Copy and paste the following code into your project.
{#if viewerData} {/if} {/snippet}Usage
<script lang="ts">
import * as ContextMenu from "$lib/components/ui/context-menu/index.js";
</script>
<ContextMenu.Root>
<ContextMenu.Trigger>Right click</ContextMenu.Trigger>
<ContextMenu.Content>
<ContextMenu.Item>Profile</ContextMenu.Item>
<ContextMenu.Item>Billing</ContextMenu.Item>
<ContextMenu.Item>Team</ContextMenu.Item>
<ContextMenu.Item>Subscription</ContextMenu.Item>
</ContextMenu.Content>
</ContextMenu.Root>