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

<mth-sparkline>

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

Accessible inline SVG sparkline (line, area, and bar) with <title>, <desc>, and screen-reader numeric summary 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

Interactive StageLive Custom Element · <mth-sparkline> (@methane-ui/ui)
Ready · interact with <mth-sparkline>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/sparkline"></script>
<mth-sparkline type="line" variant="accent">Example</mth-sparkline>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
values—ReadonlyArray<number>—Numeric series array to plot.
datadatastring""Comma- or whitespace-separated numeric values for declarative HTML/SSR usage.
typetype'line' | 'area' | 'bar'"line"Visualization mode (line, area, or bar).
variantvariant'accent' | 'success' | 'warning' | 'danger' | 'neutral'"accent"Semantic stroke/fill palette (accent, success, warning, danger, neutral).
labellabelstring""Accessible chart title used in SVG <title>.
showPointsshow-pointsbooleanfalseRenders circular point markers on each data vertex.
minminnumber | nullnullOptional explicit lower bound for Y-axis scaling.
maxmaxnumber | nullnullOptional explicit upper bound for Y-axis scaling.

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
statesExposes ElementInternals CustomStateSet flags: :state(empty).Conformance suite
i18nRoutes 3 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test