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

<mth-role-matrix>

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

Interactive role-by-permission authorization matrix grid with 2D roving keyboard navigation and readonly enforcement.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/auth/role-matrix"></script>
<mth-role-matrix></mth-role-matrix>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
roles—ReadonlyArray<unknown>—Columns representing roles.
permissions—ReadonlyArray<unknown>—Rows representing permissions.
grants—unknown—Mapping of role ID to granted permission IDs.
readonlyreadonlybooleanfalsePrevents mutating role permission grants while keeping navigation intact.
disableddisabledbooleanfalseDisables all matrix cells.
labellabelstring""Accessible label for the permissions grid.

Events

EventDetail TypeDescription
mth-change{ roleId: string; permissionId: string; granted: boolean; grants: unknown }Emitted when a permission grant is toggled.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowRightltrGrid cell focusedMoves focus to next column cell
ArrowDownbothGrid cell focusedMoves focus to cell in next row

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 2 APG keyboard transitions across LTR/RTL.mth-role-matrix.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(readonly), :state(disabled).Conformance suite
i18nRoutes 6 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test