mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
31 lines
No EOL
769 B
Text
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" /> |