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

<mth-suggestion-chips>

@methane-ui/ai~7.9 KB brotli (kit + Lit)~2.0 KB marginal

Starter prompt chip bar with RTL-aware RovingFocusController navigation and mth-select event dispatch.

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-suggestion-chips> (@methane-ui/ai)
Ready · interact with <mth-suggestion-chips>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ai/suggestion-chips"></script>
<mth-suggestion-chips orientation="horizontal">Example</mth-suggestion-chips>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
items—unknown[]—Array of { id?, label, value?, prompt?, disabled? } starter prompt items.
labellabelstring""Accessible region label for the suggestion bar.
orientationorientation'horizontal' | 'vertical'"horizontal"Horizontal or vertical chip flow.
disableddisabledbooleanfalseDisables all suggestion chips.

Events

EventDetail TypeDescription
mth-select{ label: string; value: string; index: number }Fired when the user activates a suggestion chip.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowRightltrchip focusedmoves focus to next suggestion (RTL flipped)
ArrowLeftltrchip focusedmoves focus to previous suggestion (RTL flipped)
Homebothchip focusedmoves focus to first suggestion
Endbothchip focusedmoves focus to last suggestion

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 4 APG keyboard transitions across LTR/RTL.mth-suggestion-chips.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(disabled).Conformance suite
i18nRoutes 1 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test