From 9f3cb09694fde583c0c47b4e7dd3940fac96959f Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sun, 20 Apr 2025 15:16:45 -0700 Subject: [PATCH] docs(context-menu): improve docs --- docs/src/pages/components/ContextMenu.svx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/src/pages/components/ContextMenu.svx b/docs/src/pages/components/ContextMenu.svx index eacc8ac6..3ef81928 100644 --- a/docs/src/pages/components/ContextMenu.svx +++ b/docs/src/pages/components/ContextMenu.svx @@ -6,26 +6,32 @@ components: ["ContextMenu", "ContextMenuGroup", "ContextMenuRadioGroup", "Contex import Preview from "../../components/Preview.svelte"; +`ContextMenu` displays a menu when users right-click. Use it to provide quick access to contextual actions or options. + In the examples, right click anywhere within the iframe. ## Default -By default, the context menu will trigger when right clicking anywhere in the `window`. +The context menu appears when right-clicking anywhere in the window. Use `ContextMenuOption` for menu items and `ContextMenuDivider` for visual separation. ## Custom target -Specify a custom `HTMLElement` using the `target` prop. +By default, the context menu will trigger when right clicking anywhere in the `window`. + +Set `target` to specify which element triggers the context menu. ## Multiple targets -The `target` prop also accepts an array of elements. +Set `target` to an array of elements to trigger the context menu from multiple sources. ## Radio groups - + +Use `ContextMenuGroup` and `ContextMenuRadioGroup` to organize related options and create radio button selections. + \ No newline at end of file