Quaff

QSplitBtn

Split buttons pair a primary action with a menu of alternatives. Keep the common action accessible while offering related choices in one control.

Print a proof

Choose the main action or a menu alternative.

info QSplitBtn API Source


disabled
?: boolean = false
Puts the component into a disabled state, which prevents user interaction.

expanded
?: boolean = $bindable(false)
Whether the menu is open. This property is bindable.

href
?: string = undefined
Makes the component navigational, typically used for links to set the URL or route it should navigate to.

icon
?: QBtnIcon = undefined
Icon to display on the leading edge of the button.

label
?: string = undefined
Text for the primary action. Menu content is supplied through children.

loading
?: boolean = false
Puts the button in a loading state, adding a loader as the leading icon.

menuLabel
: string = undefined
Accessible name for the menu button, such as "More send options".

noRipple
?: boolean = false
Disables the ripple effect on click.

replace
?: boolean = false
Replaces the current entry in the browser's history rather than adding a new one. This is the same as setting the `data-sveltekit-replacestate` attribute to "true".

rippleColor
?: string = undefined
Sets the ripple effect's color for the component. If omitted, the ripple will inherit the component's text color.

size
?: QBtnProps["size"] = "sm"
Expressive size, from xs to xl. Defaults to sm (40px minimum height).

target
?: HTMLAnchorAttributes["target"] = undefined
For navigational components only, sets or retrieves the window or frame at which to target content.

to
?: string = undefined
Makes the component navigational, typically used for links to set the URL or route it should navigate to. As it is the same as href, it is recommended to use href instead.

variant
?: Exclude<QBtnVariantOptions, "flat"> = "filled"
Button style. Defaults to filled.

Usage

Primary Action and Menu
The leading button runs the primary onclick action. The trailing button opens related actions supplied through children. Give that menu a contextual menuLabel. Try printing in color, choosing monochrome, or exporting a PDF.

Choose the main action or a menu alternative.

Variants, Sizes and Icons
QSplitBtn always uses expressive styling. It defaults to filled and sm; both halves share their variant and size. An icon can be an icon name or a snippet. Bind expanded to observe or control the menu.
Custom print icon
Menu: closed.

Choose the main action or a menu alternative.

Opening the menu changes the trailing button's shape and rotates its icon. Large sizes scroll within this preview. noRipple and rippleColor configure both halves.

Loading and Disabled
loading replaces the leading icon while keeping the menu available. Prevent duplicate work in your action handlers; this example also disables its print menu item while loading. disabled disables both halves.
Loading
Disabled

No print requested.