← All Components
<mth-scroll-area>
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
@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>import '@methane-ui/ui/scroll-area';
import '@methane-ui/react';
export function Example() {
return <mth-scroll-area type="auto" orientation="vertical">Example</mth-scroll-area>;
}<script setup lang="ts">
import '@methane-ui/ui/scroll-area';
</script>
<template>
<mth-scroll-area type="auto" orientation="vertical">Example</mth-scroll-area>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/scroll-area';
import { MthScrollAreaDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthScrollAreaDirective],
template: `<mth-scroll-area type="auto" orientation="vertical">Example</mth-scroll-area>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/scroll-area';
import MthScrollArea from '@methane-ui/svelte/MthScrollArea.svelte';
</script>
<MthScrollArea type="auto" orientation="vertical">Example</MthScrollArea>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
type | type | 'auto' | 'always' | 'scroll' | 'hover' | "hover" | Scrollbar visibility policy (auto, always, scroll, or hover). |
orientation | orientation | 'vertical' | 'horizontal' | 'both' | "vertical" | Allowed scroll axes (vertical, horizontal, or both). |
label | label | string | "" | Optional accessible region label when viewport is scrollable. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-scroll | { scrollTop: number; scrollLeft: number } | Fired when the viewport scrolls. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowDown | both | Viewport is focused | Scrolls block axis forward natively |
| PageDown | both | Viewport is focused | Scrolls viewport by one page |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 2 APG keyboard transitions across LTR/RTL. | mth-scroll-area.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(scrolling). | Conformance suite |