← All Components
<mth-skeleton>
Decorative loading placeholder (aria-hidden="true") supporting text lines, circular, and rectangular variants via CSS custom properties.
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-skeleton>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/skeleton"></script>
<mth-skeleton variant="text" lines="1"></mth-skeleton>import '@methane-ui/ui/skeleton';
import '@methane-ui/react';
export function Example() {
return <mth-skeleton variant="text" lines="1"></mth-skeleton>;
}<script setup lang="ts">
import '@methane-ui/ui/skeleton';
</script>
<template>
<mth-skeleton variant="text" lines="1"></mth-skeleton>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/skeleton';
import { MthSkeletonDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthSkeletonDirective],
template: `<mth-skeleton variant="text" lines="1"></mth-skeleton>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/skeleton';
import MthSkeleton from '@methane-ui/svelte/MthSkeleton.svelte';
</script>
<MthSkeleton variant="text" lines="1"></MthSkeleton>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
variant | variant | 'text' | 'circular' | 'rectangular' | "text" | Placeholder geometry (text | circular | rectangular). |
lines | lines | number | 1 | Number of placeholder lines rendered when variant="text". |
animated | animated | boolean | true | Enables shimmer/pulse animation (disabled automatically under prefers-reduced-motion: reduce). |
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 |
| states | Exposes ElementInternals CustomStateSet flags: :state(animated). | Conformance suite |