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

<mth-spreadsheet>

@methane-ui/spreadsheet~11.2 KB brotli shell + lazy engine~3.8 KB shell · lazy engine chunk

Virtualized spreadsheet satellite with clean-room MIT Formula AST evaluator, A1/R1C1 addressing, cycle detection, keyboard navigation, and TSV clipboard support.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/spreadsheet/spreadsheet"></script>
<mth-spreadsheet rows="20" cols="8"></mth-spreadsheet>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
rowsrowsnumber20Total number of worksheet rows.
colscolsnumber8Total number of worksheet columns.
cells—Readonly<Record<string, string>>—Map of A1 cell addresses to raw scalar or formula strings.
addressModeaddress-mode'A1' | 'R1C1'"A1"Cell reference display mode (A1 or R1C1).
activeCellactive-cellstring"A1"Currently focused A1 cell address.
rowHeightrow-heightnumber32Estimated row height in pixels.
readonlyreadonlybooleanfalsePrevents cell editing.
labellabelstring""Accessible worksheet label.

Events

EventDetail TypeDescription
mth-cell-select{ address: string; displayAddress: string; raw: string; value: unknown }Fired when the active cell selection moves.
mth-cell-change{ address: string; raw: string; value: unknown }Fired when a cell value or formula is committed.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowDownbothcell focusedmoves active cell one row down
ArrowUpbothcell focusedmoves active cell one row up
ArrowRightbothcell focusedmoves active cell inline-end (direction-aware)
ArrowLeftbothcell focusedmoves active cell inline-start (direction-aware)
Enterbothcell focusedopens inline formula/value editor or commits edit
Escapebothediting cellcancels edit without committing

Accessibility Checklist

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