carbon-components-svelte/docs/src/pages/components/ContextMenu.svx
2022-08-17 07:15:29 -07:00

31 lines
No EOL
769 B
Text

---
components: ["ContextMenu", "ContextMenuGroup", "ContextMenuRadioGroup", "ContextMenuOption", "ContextMenuDivider"]
---
<script>
import Preview from "../../components/Preview.svelte";
</script>
In the examples, right click anywhere within the iframe.
## Default
By default, the context menu will trigger when right clicking anywhere in the `window`.
<FileSource src="/framed/ContextMenu/ContextMenu" />
## Custom target
Specify a custom `HTMLElement` using the `target` prop.
<FileSource src="/framed/ContextMenu/ContextMenuTarget" />
## Multiple targets
The `target` prop also accepts an array of elements.
<FileSource src="/framed/ContextMenu/ContextMenuTargets" />
## Radio groups
<FileSource src="/framed/ContextMenu/ContextMenuGroups" />