mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
47 lines
1.2 KiB
Svelte
47 lines
1.2 KiB
Svelte
<script lang="ts">
|
|
import { OverflowMenu, OverflowMenuItem } from "carbon-components-svelte";
|
|
|
|
export let size: "sm" | "xl" | undefined = undefined;
|
|
export let light: boolean = false;
|
|
export let flipped: boolean = false;
|
|
export let direction: "top" | "bottom" = "bottom";
|
|
export let menuOptionsClass: string | undefined = undefined;
|
|
export let iconClass: string | undefined = undefined;
|
|
export let iconDescription: string = "Open and close list of options";
|
|
export let id: string = "ccs-" + Math.random().toString(36);
|
|
</script>
|
|
|
|
<OverflowMenu
|
|
{size}
|
|
{light}
|
|
{flipped}
|
|
{direction}
|
|
{menuOptionsClass}
|
|
{iconClass}
|
|
{iconDescription}
|
|
{id}
|
|
on:close={(e) => {
|
|
console.log("close", e.detail); // { index: number; text: string; }
|
|
}}
|
|
>
|
|
<OverflowMenuItem
|
|
text="Manage credentials"
|
|
on:click={() => {
|
|
console.log("click", "Manage credentials");
|
|
}}
|
|
/>
|
|
<OverflowMenuItem
|
|
href="https://cloud.ibm.com/docs/api-gateway/"
|
|
text="API documentation"
|
|
on:click={() => {
|
|
console.log("click", "API documentation");
|
|
}}
|
|
/>
|
|
<OverflowMenuItem
|
|
danger
|
|
text="Delete service"
|
|
on:click={() => {
|
|
console.log("click", "Delete service");
|
|
}}
|
|
/>
|
|
</OverflowMenu>
|