Skip to content

Split Button

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.

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

Sample

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
appearanceappearanceSpecifies the appearance style of the component."outline" | "outline-fill" | "solid" | "transparent""solid"
disableddisabledWhen true, interaction is prevented and the component is displayed with lower opacity.booleanfalse
downloaddownloadPrompts 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.boolean | stringfalse
dropdownIconTypedropdown-icon-typeSpecifies the icon used for the dropdown menu."caret" | "chevron" | "ellipsis" | "overflow""chevron"
dropdownLabeldropdown-labelAccessible name for the dropdown menu.string
flipPlacementsSpecifies the component's fallback slotted content placement when it's initial or specified placement has insufficient space available.Array<"top" | "bottom" | "right" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end" | "leading-start" | "leading" | "leading-end" | "trailing-end" | "trailing" | "trailing-start">
hrefhrefSpecifies the URL of the linked resource, which can be set as an absolute or relative path.string
kindkindSpecifies the kind of the component, which will apply to border and background, if applicable."brand" | "danger" | "inverse" | "neutral""brand"
loadingloadingWhen true, a busy indicator is displayed on the primary button.booleanfalse
overlayPositioningoverlay-positioningDetermines the type of positioning to use for the overlaid content. Using "absolute" will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout. "fixed" should be used to escape an overflowing parent container, or when the reference element's position CSS property is "fixed"."absolute" | "fixed""absolute"
placementplacementDetermines where the component will be positioned relative to the container element."bottom" | "bottom-end" | "bottom-start" | "top" | "top-end" | "top-start""bottom-end"
primaryIconEndprimary-icon-endSpecifies an icon to display at the end of the primary button.string
primaryIconFlipRtlprimary-icon-flip-rtlDisplays the primaryIconStart and/or primaryIconEnd as flipped when the element direction is right-to-left ("rtl")."both" | "end" | "start"
primaryIconStartprimary-icon-startSpecifies an icon to display at the start of the primary button.string
primaryLabelprimary-labelAccessible name for the primary button.string
primaryTextprimary-textText displayed in the primary button.string
relrelDefines the relationship between the href value and the current document.string
scalescaleSpecifies the size of the component."l" | "m" | "s""m"
targettargetSpecifies where to open the linked document defined in the href property.string
widthwidthSpecifies the width of the component. [Deprecated] The "half" value is deprecated, use "full" instead."auto" | "full" | "half""auto"

Slots

NameDescription
default (unnamed)A slot for adding calcite-dropdown content.

Events

NameDescriptionBehavior
calciteSplitButtonPrimaryClickFires when the primary button is clicked.bubblescomposed
calciteSplitButtonSecondaryClickFires when the dropdown menu is clicked.bubblescomposed

Methods

NameDescriptionSignature
componentOnReadyCreate a promise that resolves once component is fully loaded.componentOnReady(): Promise<void>
setFocusSets focus on the component's first focusable element.setFocus(): Promise<void>

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