← All Components
<mth-formula-bar>
Spreadsheet formula bar satellite with FACE form integration, live Formula AST dependency inspection, and IME-safe InputController editing.
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-formula-bar>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/spreadsheet/formula-bar"></script>
<mth-formula-bar cell-address="A1"></mth-formula-bar>import '@methane-ui/spreadsheet/formula-bar';
import '@methane-ui/react';
export function Example() {
return <mth-formula-bar cell-address="A1"></mth-formula-bar>;
}<script setup lang="ts">
import '@methane-ui/spreadsheet/formula-bar';
</script>
<template>
<mth-formula-bar cell-address="A1"></mth-formula-bar>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/spreadsheet/formula-bar';
import { MthFormulaBarDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthFormulaBarDirective],
template: `<mth-formula-bar cell-address="A1"></mth-formula-bar>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/spreadsheet/formula-bar';
import MthFormulaBar from '@methane-ui/svelte/MthFormulaBar.svelte';
</script>
<MthFormulaBar cell-address="A1"></MthFormulaBar>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
name | name | string | "" | Form field name submitted with parent form. |
value | value | string | "" | Current cell value or formula string. |
cellAddress | cell-address | string | "A1" | Active cell reference displayed in the address box. |
placeholder | placeholder | string | "" | Optional placeholder override. |
disabled | disabled | boolean | false | Disables editing and excludes control from form submission. |
required | required | boolean | false | Requires non-empty formula or value. |
readonly | readonly | boolean | false | Prevents editing while preserving selection and form value. |
label | label | string | "" | Accessible formula bar label. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-formula-input | { cellAddress: string; value: string; dependencies: ReadonlyArray<string> } | Fired as the formula text changes. |
mth-formula-commit | { cellAddress: string; value: string; valid: boolean } | Fired when the user presses Enter or activates Apply. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Enter | both | formula input focused | commits formula and emits mth-formula-commit |
| Escape | both | formula input focused | reverts formula draft to committed value |
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 2 APG keyboard transitions across LTR/RTL. | mth-formula-bar.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(invalid), :state(formula). | Conformance suite |
| i18n | Routes 7 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |