← All Components
<mth-suggestion-chips>
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
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>import '@methane-ui/ai/suggestion-chips';
import '@methane-ui/react';
export function Example() {
return <mth-suggestion-chips orientation="horizontal">Example</mth-suggestion-chips>;
}<script setup lang="ts">
import '@methane-ui/ai/suggestion-chips';
</script>
<template>
<mth-suggestion-chips orientation="horizontal">Example</mth-suggestion-chips>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ai/suggestion-chips';
import { MthSuggestionChipsDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthSuggestionChipsDirective],
template: `<mth-suggestion-chips orientation="horizontal">Example</mth-suggestion-chips>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ai/suggestion-chips';
import MthSuggestionChips from '@methane-ui/svelte/MthSuggestionChips.svelte';
</script>
<MthSuggestionChips orientation="horizontal">Example</MthSuggestionChips>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
items | — | unknown[] | — | Array of { id?, label, value?, prompt?, disabled? } starter prompt items. |
label | label | string | "" | Accessible region label for the suggestion bar. |
orientation | orientation | 'horizontal' | 'vertical' | "horizontal" | Horizontal or vertical chip flow. |
disabled | disabled | boolean | false | Disables all suggestion chips. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-select | { label: string; value: string; index: number } | Fired when the user activates a suggestion chip. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowRight | ltr | chip focused | moves focus to next suggestion (RTL flipped) |
| ArrowLeft | ltr | chip focused | moves focus to previous suggestion (RTL flipped) |
| Home | both | chip focused | moves focus to first suggestion |
| End | both | chip focused | moves focus to last suggestion |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="none". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 4 APG keyboard transitions across LTR/RTL. | mth-suggestion-chips.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled). | Conformance suite |
| i18n | Routes 1 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |