Skip to content
Focsd homeFocsd homeFocsd
Forms

Scroll area

A height-limited region whose content scrolls.

  • Tag: focsd-scroll-area
  • Pattern: Focusable scroll region
  • Category: Layout

Example

v0.4: Added data grid.

v0.3: Added overlays.

v0.2: Added forms.

v0.1: Initial release.

HTML
<focsd-scroll-area label="Release notes" max-block-size="6rem">
<p>v0.4: Added data grid.</p>
<p>v0.3: Added overlays.</p>
<p>v0.2: Added forms.</p>
<p>v0.1: Initial release.</p>
</focsd-scroll-area>

Usage

Import the module once, then use the tag like any HTML element. Every framework below renders the same element; see Frameworks for setup.

<script type="module">
import '@focsd-dev/components/focsd-scroll-area.js';
</script>
<focsd-scroll-area label="Release notes" max-block-size="6rem">…</focsd-scroll-area>

API

Attributes

AttributePropertyTypeDefault
labellabelstring—
max-block-sizemaxBlockSizestring—

Slots

SlotDescription
(default)Default content.

CSS parts

Style the inside of the component with ::part(), for example focsd-scroll-area::part(viewport).

PartDescription
viewportThe viewport element.

Accessibility

  • A focusable, labeled role="region", so keyboard users can scroll it (WCAG 2.1.1).

Keyboard

KeyAction
Arrow keys / Page Up / DownScroll (when focused)