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

<mth-key-value>

@methane-ui/ui~6.8 KB brotli (cold + Lit)~1.4 KB marginal

Accessible semantic <dl>/<dt>/<dd> key-value pair with horizontal/vertical layout, monospace formatting, and one-click clipboard copy.

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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/key-value"></script>
<mth-key-value orientation="horizontal">Example</mth-key-value>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
labellabelstring""Key label text when label slot is not provided.
valuevaluestring""Value text when default slot is not provided.
orientationorientation'horizontal' | 'vertical'"horizontal"Arrangement of label and value (horizontal or vertical).
copyablecopyablebooleanfalseDisplays a clipboard copy button next to the value.
monospacemonospacebooleanfalseRenders the value in a monospace font stack.

Events

EventDetail TypeDescription
mth-copy{ value: string; ok: boolean }Emitted after attempting to copy the value to the clipboard.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
EnterbothCopy button is focusedCopies value to clipboard and emits mth-copy
bothCopy button is focusedCopies value to clipboard and emits mth-copy

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".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-key-value.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(copied), :state(monospace).Conformance suite
i18nRoutes 4 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test