Something went wrong. Try again.
Monorepo for Tangled
Something went wrong. Try again.
Svelte
12345678910111213141516171819202122232425262728293031323334353637383940414243444546<script module lang="ts"> import { defineMeta } from "@storybook/addon-svelte-csf"; import GitMerge from "$icon/git-merge"; import CircleCheck from "$icon/circle-check"; import Trash2 from "$icon/trash-2"; import SplitButton from "$lib/components/ui/SplitButton.svelte";
const { Story } = defineMeta({ title: "UI/SplitButton", component: SplitButton, tags: ["autodocs"], args: { options: [ { label: "Merge (rebase)", icon: GitMerge }, { label: "Manually mark as merged", buttonLabel: "Merge (manual)", icon: CircleCheck } ] } });</script>
<!-- Picking from the menu arms an option, it does not run it — the primary button takes over the armed option's label, icon and handler. -->
<Story name="Default" />
<Story name="Primary" args={{ variant: "primary" }} />
<!-- Button owns the spinner, so `loading` disables the primary half on its own --><Story name="Loading" args={{ variant: "primary", loading: true }} />
<Story name="Disabled" args={{ disabled: true }} />
<Story name="With a danger option" args={{ options: [ { label: "Merge (rebase)", icon: GitMerge }, { label: "Close without merging", icon: Trash2, danger: true } ] }}/>