View as Markdown

API reference: @salmonui/buttons/menu

SplitButtonPropsinterface

import type { SplitButtonProps } from '@salmonui/buttons/menu';
interface SplitButtonProps extends MenuButtonMenuProps, Omit<ButtonBaseProps, 'children' | 'ref' | 'className' | 'style' | 'render' | 'repeat' | 'onRepeat' | 'iconOnly' | 'floating' | 'floatingScope'> {
    readonly children?: ReactNode;
    readonly menuLabel?: string;
    readonly indicator?: ReactNode;
    readonly className?: string;
    readonly style?: CSSProperties;
    readonly classNames?: Partial<Record<SplitButtonPart, string>>;
    readonly styles?: Partial<Record<SplitButtonPart, CSSProperties>>;
    readonly ref?: Ref<HTMLButtonElement>;
}
SplitButtonProps members (29, 21 inherited)
NameSignatureDescription
menuoptionalinheritedmenu?: ReactNode;

Menu entries as JSX (MenuItem, MenuCheckboxItem, MenuRadioGroup, MenuGroup, MenuSeparator, Submenu). Wins over items.

itemsoptionalinheriteditems?: readonly MenuItemData[];

Data form of the menu entries.

renderItemoptionalinheritedrenderItem?: ((item: MenuItemData) => ReactNode);

Content of each items entry (default: its label).

openoptionalinheritedopen?: boolean;
defaultOpenoptionalinheriteddefaultOpen?: boolean;

Applied after hydration (server and client markup stay identical).

onOpenChangeoptionalinheritedonOpenChange?: ((open: boolean, event: MenuOpenChangeEvent) => void);
childrenoptionalreadonly children?: ReactNode;

Primary button content (also the group's accessible name).

menuLabeloptionalreadonly menuLabel?: string;

Accessible name of the menu trigger (default "More options").

indicatoroptionalreadonly indicator?: ReactNode;

Trigger content (default chevron).

classNameoptionalreadonly className?: string;

Root (role="group") class and style.

styleoptionalreadonly style?: CSSProperties;
classNamesoptionalreadonly classNames?: Partial<Record<SplitButtonPart, string>>;
stylesoptionalreadonly styles?: Partial<Record<SplitButtonPart, CSSProperties>>;
refoptionalreadonly ref?: Ref<HTMLButtonElement>;

The primary <button>.

variantoptionalinheritedvariant?: ButtonVariant;

Visual weight. Default 'solid' (or the group's).

toneoptionalinheritedtone?: ButtonTone;

Color role. Default 'neutral'; 'primary' for a floating button (or the group's).

sizeoptionalinheritedsize?: ButtonSize;

Metric set. Default 'md' (or the group's).

iconStartoptionalinheritediconStart?: ReactNode;

Decorative icon before the label (inline-start; follows dir).

iconEndoptionalinheritediconEnd?: ReactNode;

Decorative icon after the label (inline-end; follows dir).

loadingoptionalinheritedloading?: boolean;

Shows a spinner, sets aria-busy and aria-disabled (focus is kept) and ignores activation.

loadingLabeloptionalinheritedloadingLabel?: string;

Visually hidden text appended to the name while loading. Default "Loading".

spinneroptionalinheritedspinner?: ReactNode;

Replaces the built-in spinner graphic.

progressoptionalinheritedprogress?: number;

Progress fill from inline-start, 0 to 100. No spinner unless loading.

progressLabeloptionalinheritedprogressLabel?: ((value: number) => string);

Visually hidden progress text appended to the name. Default `${value}%`.

onActionoptionalinheritedonAction?: ((event: MenuActionEvent) => void);

A chosen item (any level); event.preventDefault() keeps the menu open.

placementoptionalinheritedplacement?: MenuPlacement;

Default 'bottom-start'; flips and shifts to stay in the viewport; logical (mirrored in RTL).

containeroptionalinheritedcontainer?: Element | null;

Portal target (default: the trigger's document.body).

submenuOpenoptionalinheritedsubmenuOpen?: MenuSubmenuOpen;

Submenus open after a pointer rest of hoverDelay ms (default 'hover') or on click only.

hoverDelayoptionalinheritedhoverDelay?: number;

Hover intent of submenus in ms (default 200).