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

<mth-link>

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

Token-styled accessible hyperlink with automatic noopener noreferrer hardening and URL allowlist checks.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Multi-Framework Playground & Snippets

Properties & Attributes

PropertyAttributeTypeDefaultDescription
hrefhrefstring""Destination URL (https:, http:, mailto:, tel:, or relative paths).
targettargetstring""Link browsing context target.
relrelstring""Relationship attribute; _blank targets automatically enforce noopener noreferrer.
externalexternalbooleanfalseMarks link as external, defaulting target to _blank when unset and displaying an indicator.
disableddisabledbooleanfalseMarks the link aria-disabled="true", omits href, and blocks activation.
underlineunderline'always' | 'hover' | 'none'"always"Underline behavior (always, hover, or none).

Events

EventDetail TypeDescription
mth-press{ originalEvent: Event }Cancelable event fired when an enabled link is activated.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
EnterbothEnabled link is focusedActivates the link and emits cancelable mth-press

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 1 APG keyboard transitions across LTR/RTL.mth-link.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(disabled), :state(external).Conformance suite
i18nRoutes 1 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test