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

<mth-scroll-area>

@methane-ui/ui~7.9 KB brotli (cold + Lit)~2.0 KB marginal

Custom-styled accessible scroll container with logical scrollbar indicators updated via ObserverPoolController and CSP-safe adoptedStyleSheets.

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-scroll-area> (@methane-ui/ui)
@methane-ui/core — Lit base & runtime
@methane-ui/tokens — OKLCH DTCG tokens
@methane-ui/css — Logical CSS primitives
@methane-ui/primitives — Behavior controllers
@methane-ui/ui — 167 core Web Components
@methane-ui/ssr — DSD server renderer
@methane-ui/react — React 19 wrappers
@methane-ui/vue — Vue 3 wrappers
@methane-ui/svelte — Svelte 5 wrappers
@methane-ui/angular — Angular standalone wrappers
Ready · interact with <mth-scroll-area>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/scroll-area"></script>
<mth-scroll-area type="auto" orientation="vertical">Example</mth-scroll-area>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
typetype'auto' | 'always' | 'scroll' | 'hover'"hover"Scrollbar visibility policy (auto, always, scroll, or hover).
orientationorientation'vertical' | 'horizontal' | 'both'"vertical"Allowed scroll axes (vertical, horizontal, or both).
labellabelstring""Optional accessible region label when viewport is scrollable.

Events

EventDetail TypeDescription
mth-scroll{ scrollTop: number; scrollLeft: number }Fired when the viewport scrolls.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowDownbothViewport is focusedScrolls block axis forward natively
PageDownbothViewport is focusedScrolls viewport by one page

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 2 APG keyboard transitions across LTR/RTL.mth-scroll-area.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(scrolling).Conformance suite