← All Components
<mth-card>
Surface container card with elevated, outlined, and subtle variants, interactive affordances, and structured slots.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Layered key-light and ambient elevation with crisp OKLCH border contrast.
Ready · interact with <mth-card>, or toggle Theme, Direction (LTR/RTL), or props above.
Live Variants & States Showcase
variant="elevated"Elevated Card
Multi-stop ambient shadow surface.
variant="outlined"Outlined Card
Crisp architectural hairline border.
variant="subtle" interactiveSubtle Interactive
Recessed card with hover elevation.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/card"></script>
<mth-card variant="elevated">Example</mth-card>import '@methane-ui/ui/card';
import '@methane-ui/react';
export function Example() {
return <mth-card variant="elevated">Example</mth-card>;
}<script setup lang="ts">
import '@methane-ui/ui/card';
</script>
<template>
<mth-card variant="elevated">Example</mth-card>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/card';
import { MthCardDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthCardDirective],
template: `<mth-card variant="elevated">Example</mth-card>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/card';
import MthCard from '@methane-ui/svelte/MthCard.svelte';
</script>
<MthCard variant="elevated">Example</MthCard>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
variant | variant | 'elevated' | 'outlined' | 'subtle' | "elevated" | Surface elevation and border style (elevated | outlined | subtle). |
interactive | interactive | boolean | false | Applies interactive hover/focus-within affordances. |
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(interactive). | Conformance suite |