Skip to content
loseta

Components / Surfaces

Scroll Area

A scroll container with native styled scrollbars.

Status stableWorks with badge

loseta copies readable CSS files into your project.

The registry validates layers, dependencies and generated examples.

Eight styles share one markup contract.

The docs site renders the same files consumers install.

Scrollbars use the reserved scrollbar tokens.

<div class="scroll-area" role="region" aria-label="Scrollable content" tabindex="0" style="max-height: 8rem; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.75rem">
  <p>loseta copies readable CSS files into your project.</p>
  <p>The registry validates layers, dependencies and generated examples.</p>
  <p>Eight styles share one markup contract.</p>
  <p>The docs site renders the same files consumers install.</p>
  <p>Scrollbars use the reserved scrollbar tokens.</p>
</div>

Installation

pnpm dlx loseta add scroll-area
npx loseta add scroll-area

Examples

Vertical

loseta copies readable CSS files into your project.

The registry validates layers, dependencies and generated examples.

Eight styles share one markup contract.

The docs site renders the same files consumers install.

Scrollbars use the reserved scrollbar tokens.

This region is focusable so keyboard users can scroll it.

No JavaScript is involved in the scrollbar styling.

<div class="scroll-area" role="region" aria-label="Scrollable content" tabindex="0" style="max-height: 10rem; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.75rem">
  <p>loseta copies readable CSS files into your project.</p>
  <p>The registry validates layers, dependencies and generated examples.</p>
  <p>Eight styles share one markup contract.</p>
  <p>The docs site renders the same files consumers install.</p>
  <p>Scrollbars use the reserved scrollbar tokens.</p>
  <p>This region is focusable so keyboard users can scroll it.</p>
  <p>No JavaScript is involved in the scrollbar styling.</p>
</div>

Horizontal, small

Accordion Avatar Breadcrumb Context menu Drawer Hover card Menubar Navigation menu Sheet
<div class="scroll-area" data-size="sm" data-orientation="horizontal" role="region" aria-label="Scrollable row" tabindex="0" style="border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.75rem">
  <div style="display: flex; gap: 0.5rem; width: max-content">
    <span class="badge">Accordion</span>
    <span class="badge">Avatar</span>
    <span class="badge">Breadcrumb</span>
    <span class="badge">Context menu</span>
    <span class="badge">Drawer</span>
    <span class="badge">Hover card</span>
    <span class="badge">Menubar</span>
    <span class="badge">Navigation menu</span>
    <span class="badge">Sheet</span>
  </div>
</div>

Accessibility and behavior

  • Put .scroll-area on the scroll container and size it with your own layout or inline styles. Native scrollbars follow the --scrollbar-* tokens; data-orientation limits the axis and data-size="sm" narrows the scrollbar. A scrollable region needs tabindex="0" and an accessible name.

Files

components/scroll-area.cssbase
styles/nova/scroll-area.cssstyle

Install contract

The CLI writes the base file under components/, the visual file for the selected style under styles/<name>/, and any primitive dependency underprimitives/. The generated index.css imports them in the right layer order.

← Back to components

loseta is MIT licensed. Built with native CSS, no runtime. Inspired byshadcn/ui.