You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte-kit-vice/src/uix/eidos/components/dropdown-menu/dropdown-menu-checkbox-item...

26 lines
913 B

<script lang="ts">
/**
* Eidos `<DropdownMenu.CheckboxItem>`. Defaults
* `closeOnSelect={false}` because a checkbox is a state toggle, not
* a one-shot action — the user typically wants to toggle multiple
* options without having to re-open the menu each time. Pass
* `closeOnSelect` explicitly to override (Radix Primitives leaves
* the close behaviour to the consumer; we pick the saner default).
*/
import * as DropdownMenu from '$soma/components/dropdown-menu';
import type { DropdownMenuCheckboxItemProps } from './types';
let {
checked = $bindable(false),
closeOnSelect = false,
children: bodyContent,
...rest
}: DropdownMenuCheckboxItemProps = $props();
</script>
<DropdownMenu.CheckboxItem data-animation-style="fade" {...rest} {closeOnSelect} bind:checked>
{#snippet children(snippetProps)}
{@render bodyContent?.(snippetProps)}
{/snippet}
</DropdownMenu.CheckboxItem>

Powered by TurnKey Linux.