← All Components
<mth-reaction-bar>
Accessible emoji reaction pill bar with SelectionController toggling and RTL-aware RovingFocusController navigation.
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-reaction-bar>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/chat/reaction-bar"></script>
<mth-reaction-bar multiple allow-add></mth-reaction-bar>import '@methane-ui/chat/reaction-bar';
import '@methane-ui/react';
export function Example() {
return <mth-reaction-bar multiple allow-add></mth-reaction-bar>;
}<script setup lang="ts">
import '@methane-ui/chat/reaction-bar';
</script>
<template>
<mth-reaction-bar multiple allow-add></mth-reaction-bar>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/chat/reaction-bar';
import { MthReactionBarDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthReactionBarDirective],
template: `<mth-reaction-bar multiple allow-add></mth-reaction-bar>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/chat/reaction-bar';
import MthReactionBar from '@methane-ui/svelte/MthReactionBar.svelte';
</script>
<MthReactionBar multiple allow-add></MthReactionBar>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
reactions | — | ReadonlyArray<unknown> | — | List of reaction entries ({ emoji, count, active?, label?, disabled? }). |
value | value | string | "" | Comma-separated list of currently selected reaction emojis. |
multiple | multiple | boolean | true | Allows toggling multiple reaction pills simultaneously. |
allowAdd | allow-add | boolean | true | Shows the trailing add-reaction action button. |
disabled | disabled | boolean | false | Disables all reaction interactions. |
label | label | string | "" | Accessible group label for the reaction bar. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-change | { value: string; values: ReadonlyArray<string>; emoji: string; selected: boolean } | Fired when a reaction pill selection changes. |
mth-add-reaction | undefined | Fired when the add-reaction button is activated. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowLeft / ArrowRight | both | reaction pill focused | moves focus across reaction pills (RTL-aware) |
| Home / End | both | reaction pill focused | jumps to first or last reaction item |
| Enter / Space | both | reaction pill focused | toggles selection and emits mth-change |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 3 APG keyboard transitions across LTR/RTL. | mth-reaction-bar.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled). | Conformance suite |
| i18n | Routes 3 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |