RadioMenu.svelte

A horizontal menu of joined menuitemradio buttons with one selected - the shape ColorSchemeInput takes, and any other few-way pick where the options should sit one glance apart rather than behind a select.

view source

Declarations
#

RadioMenu
#

RadioMenu.svelte view source

accepts children

import RadioMenu from '@fuzdev/fuz_ui/RadioMenu.svelte';

options

type T[]

value

The selected option, compared by identity; bindable.

type T
bindable

onselect?

Called after a click selects an option.

type (option: T) => void
optional
snippet parameters
option T

label

The display text of an option - also the default title and key source.

type (option: T) => string
snippet parameters
option T

title?

The button title, defaulting to "select X" / "X is selected" from label.

type (option: T, selected: boolean) => string
optional
snippet parameters
option T
selected boolean

key?

Keys the options list; defaults to the label.

type (option: T) => unknown
optional default (option: T): unknown => label(option)
snippet parameters
option T

children?

Custom button content in place of the label text.

type Snippet<[option: T, selected: boolean]>
optional
snippet parameters
option T
selected boolean

external types

OmitStrict<SvelteHTMLElements['menu'], 'title' | 'children' | 'onselect'>

generics

RadioMenu<T>
T

Imported by
#