TidalUI

Split button preview

One primary native action joined to a keyboard-accessible menu of related alternatives.

pro · Essentials · primitive

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/split-button

Import components/ui/tidal.css, components/ui/split-button.css. Wrap installed components in tidal-scope.

Preview

Split button component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/split-button.css";
import{TidalSplitButton}from"./components/ui/split-button";
export default()=><div className="tidal-scope"><TidalSplitButton label={"Demo"} menuLabel={"Demo"} options={[{id:"example",label:"Demo",textValue:"Demo"}]}/></div>;

API and props

TidalSplitButton.label (required)
ReactNode

Required label value accepted by this exported component.

TidalSplitButton.menuLabel (required)
string

Required menu label value accepted by this exported component.

TidalSplitButton.options (required)
ReadonlyArray<TidalSplitButtonOption>

Required options value accepted by this exported component.

TidalSplitButton.contentProps
ContentProps | undefined

Optional content props value accepted by this exported component.

TidalSplitButton.contentRef
Ref<HTMLDivElement> | undefined

Optional content ref value accepted by this exported component.

TidalSplitButton.defaultOpen
boolean | undefined

Optional default open value accepted by this exported component.

TidalSplitButton.dir
"ltr" | "rtl" | undefined

Optional dir value accepted by this exported component.

TidalSplitButton.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalSplitButton.menuDisabled
boolean | undefined

Optional menu disabled value accepted by this exported component.

TidalSplitButton.onOpenChange
((open: boolean) => void) | undefined

Callback invoked when the open change interaction is proposed.

TidalSplitButton.open
boolean | undefined

Optional open value accepted by this exported component.

TidalSplitButton.primaryLoading
boolean | undefined

Optional primary loading value accepted by this exported component.

TidalSplitButton.primaryProps
PrimaryProps | undefined

Optional primary props value accepted by this exported component.

TidalSplitButton.primaryRef
Ref<HTMLButtonElement> | undefined

Optional primary ref value accepted by this exported component.

TidalSplitButton.theme
"light" | "dark" | undefined

Optional theme value accepted by this exported component.

TidalSplitButton.triggerProps
TriggerProps | undefined

Optional trigger props value accepted by this exported component.

TidalSplitButton.triggerRef
Ref<HTMLButtonElement> | undefined

Optional trigger ref value accepted by this exported component.

TidalSplitButton.variant
"primary" | "secondary" | "ghost" | undefined

Optional variant value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas