← All Components
<mth-icon>
Semantic vector icon catalog rendered via Lit svg templates with accessible label/decorative modes and slot fallback.
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-icon>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/icon"></script>
<mth-icon size="xs">Example</mth-icon>import '@methane-ui/ui/icon';
import '@methane-ui/react';
export function Example() {
return <mth-icon size="xs">Example</mth-icon>;
}<script setup lang="ts">
import '@methane-ui/ui/icon';
</script>
<template>
<mth-icon size="xs">Example</mth-icon>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/icon';
import { MthIconDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthIconDirective],
template: `<mth-icon size="xs">Example</mth-icon>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/icon';
import MthIcon from '@methane-ui/svelte/MthIcon.svelte';
</script>
<MthIcon size="xs">Example</MthIcon>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
name | name | string | "" | Built-in icon identifier (check, close, chevron-down, chevron-right, chevron-left, chevron-up, search, info, warning, error, success, external, menu, plus, minus, user, copy, share). |
size | size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | "md" | Icon dimension preset (xs | sm | md | lg | xl). |
label | label | string | "" | Accessible label; renders role="img" with aria-label when provided, or aria-hidden="true" when decorative. |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="none". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |