Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-split-button>

@methane-ui/ui~10.1 KB brotli (cold + Lit)~3.2 KB marginal

Split action button pairing a primary button with an anchored secondary options menu.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-split-button> (@methane-ui/ui)
Ready · interact with <mth-split-button>, or toggle Theme, Direction (LTR/RTL), or props above.

Live Variants & States Showcase

variant="solid"
variant="outline"
variant="ghost"
disabled

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/split-button"></script>
<mth-split-button variant="solid" size="sm">Example</mth-split-button>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
labellabelstring""Optional primary button label when no slotted children are supplied.
variantvariant'solid' | 'outline' | 'ghost'"solid"Visual button style (solid, outline, or ghost).
sizesize'sm' | 'md' | 'lg'"md"Control size scale (sm, md, or lg).
disableddisabledbooleanfalseDisables both primary and menu trigger buttons.
openopenbooleanfalseControls visibility of the secondary dropdown menu.
menuLabelmenu-labelstring""Accessible aria-label for the dropdown toggle button.

Events

EventDetail TypeDescription
mth-press{ originalEvent: Event }Fired when the primary action button is pressed.
mth-select{ value: string; label: string }Fired when a secondary menu option is chosen.
mth-open{ open: true }Cancelable event fired before opening the menu.
mth-after-open{ open: true }Fired after open transition completes.
mth-close{ reason: string }Fired when the menu closes.
mth-after-close{ reason: string }Fired after close transition and focus restore complete.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowDownbothSecondary trigger is focusedOpens menu and focuses first enabled item
EscapebothSecondary menu is openCloses menu and restores focus to trigger

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 2 APG keyboard transitions across LTR/RTL.mth-split-button.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(open), :state(disabled).Conformance suite
i18nRoutes 1 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test