Split Buttons contain two buttons paired to provide different, but related actions.

Overview

Split Buttons house variations of the same action, and are a good utility to save space in the interface. Avoid relying on Split Buttons frequently or in groups.

Split Buttons carry the same color styles and appearances as Buttons.

Sample

Usage

Split Buttons can be used to accommodate many workflows. For instance:

PrimarySecondary
SaveSave as
DownloadDownload with a specific file extension
OpenOpen with a specific program
EditEdit with
Add layerType of layer

Best practices

Below are important guidelines on using the Split Button component.

Do Split Button text labels
Do use text labels to provide context.
Avoid Split Button icon-only
Avoid using icon only Split Buttons when the icon's action is unclear.

Accessibility

Keyboard navigation

KeyFunction
EnterIf focused on the button, presses the component. If focused on the calcite-dropdown-group, expands or collapses the calcite-dropdown-items.
SpaceIf focused on the button, presses the component. If focused on the calcite-dropdown-group, expands or collapses the calcite-dropdown-items.
TabMoves focus to the calcite-dropdown-group. If the calcite-dropdown-group is focused, the focus will leave the component.
Tab and ShiftMoves focus to the button. If the button is focused, the focus will leave the component.

Refer to Dropdown for keyboard navigation.

Writing and copy

Refer to Button for writing and copy guidelines.

API reference

Properties

PropertyAttributeDescriptionTypeDefault
appearanceappearance

Specifies the appearance style of the component.

Extract<"outline" | "outline-fill" | "solid" | "transparent", Appearance>"solid"
disableddisabled

When true, interaction is prevented and the component is displayed with lower opacity.

booleanfalse
downloaddownload

Prompts the user to save the linked URL instead of navigating to it. Can be used with or without a value: Without a value, the browser will suggest a filename/extension.

string | booleanfalse
dropdownIconTypedropdown-icon-type

Specifies the icon used for the dropdown menu.

DropdownIconType"chevron"
dropdownLabeldropdown-label

Accessible name for the dropdown menu.

string
flipPlacements

Specifies the component's fallback placement for slotted content when it's initial or specified placement has insufficient space available.

FlipPlacement[]
hrefhref

Specifies the URL of the linked resource, which can be set as an absolute or relative path.

string
kindkind

Specifies the kind of the component, which will apply to border and background, if applicable.

Extract<"brand" | "danger" | "inverse" | "neutral", Kind>"brand"
loadingloading

When true, a busy indicator is displayed on the primary button.

booleanfalse
overlayPositioningoverlay-positioning

Specifies the type of positioning to use for overlaid content, where:

"absolute" works for most cases - positioning the component inside of overflowing parent containers, which affects the container's layout, and

"fixed" is used to escape an overflowing parent container, or when the reference element's position CSS property is "fixed".

OverlayPositioning"absolute"
placementplacement

Determines where the component will be positioned relative to the container element.

LogicalPlacement"bottom-end"
primaryIconEndprimary-icon-end

Specifies an icon to display at the end of the primary button.

IconName
primaryIconFlipRtlprimary-icon-flip-rtl

Displays the primaryIconStart and/or primaryIconEnd as flipped when the element direction is right-to-left ("rtl").

FlipContext
primaryIconStartprimary-icon-start

Specifies an icon to display at the start of the primary button.

IconName
primaryLabelprimary-label

Specifies an accessible name for the primary button.

string
primaryTextprimary-text

Specifies the text displayed in the primary button.

string
relrel

Defines the relationship between the href value and the current document.

string
scalescale

Specifies the component's size.

Scale"m"
targettarget

Specifies where to open the linked document defined in the href property.

string
topLayerDisabledtop-layer-disabled

When true and the component is open, disables top layer placement.

Only set this if you need complex z-index control or if top layer placement causes conflicts with third-party components.

booleanfalse
widthwidth

Specifies the width of the component. [Deprecated] The "half" value is deprecated, use "full" instead.

Extract<Width, "auto" | "half" | "full">"auto"

Slots

NameDescription
default (unnamed)

A slot for adding calcite-dropdown content.

Styles

NameDescription
--calcite-split-button-background-color

Specifies the component's background color.

--calcite-split-button-background-color-hover

Specifies the component's background color when hovered.

--calcite-split-button-background-color-focus

Specifies the component's background color when focused.

--calcite-split-button-background-color-press

Specifies the component's background color when active.

--calcite-split-button-border-color

Specifies the component's border color.

--calcite-split-button-corner-radius

Specifies the component's corner radius.

--calcite-split-button-icon-color

Specifies the component's iconStart and iconEnd color.

--calcite-split-button-loader-color

Specifies the component's loader color.

--calcite-split-button-text-color

Specifies the component's text color.

--calcite-split-button-shadow

Specifies the component's shadow.

--calcite-split-button-divider-border-color

Specifies the component's divider border color.

--calcite-split-button-divider-color

Specifies the component's divider color.

--calcite-split-button-dropdown-width

Specifies the width of the component's dropdown.

--calcite-split-button-dropdown-background-color

Specifies the component's dropdown background color. *

Events

NameDescriptionBehavior
calciteSplitButtonPrimaryClick

Fires when the primary button is clicked.

bubblescomposed
calciteSplitButtonSecondaryClick

Fires when the dropdown menu is clicked.

bubblescomposed

Methods

NameDescriptionSignature
componentOnReady

Creates a promise that resolves once the component is fully loaded.

componentOnReady(): Promise<this>
setFocus

Sets focus on the component's first focusable element.

setFocus(options?: FocusOptions): Promise<void>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.