Skip to content
Navigation ScrollArea

ScrollArea

A styled scroll container that stays reachable with the keyboard.

On this page

Examples

Scroll area

  • Entry 1: something changed here.
  • Entry 2: something changed here.
  • Entry 3: something changed here.
  • Entry 4: something changed here.
  • Entry 5: something changed here.
  • Entry 6: something changed here.
  • Entry 7: something changed here.
  • Entry 8: something changed here.
  • Entry 9: something changed here.
  • Entry 10: something changed here.
  • Entry 11: something changed here.
  • Entry 12: something changed here.
  • Entry 13: something changed here.
  • Entry 14: something changed here.
  • Entry 15: something changed here.
  • Entry 16: something changed here.
  • Entry 17: something changed here.
  • Entry 18: something changed here.
  • Entry 19: something changed here.
  • Entry 20: something changed here.
Razor
<KlyScrollArea Class="h-40 w-full max-w-sm rounded-lg border border-(--klyroo-border)" AriaLabel="Changelog" data-testid="scroll">
    <ul class="flex flex-col gap-2 p-3 text-sm">
        @for (var i = 1; i <= 20; i++)
        {
            <li>Entry @i: something changed here.</li>
        }
    </ul>
</KlyScrollArea>

API

KlyScrollArea

Styled scroll container that stays reachable with the keyboard while its content overflows.

Parameters

Name Type Default Description
AriaLabel string Accessible name of the scrollable region.
Class string Classes added to the root element, merged last so they win over the theme.
Orientation KlyOrientation? KlyOrientation.Vertical Scrolling direction. Null scrolls both ways. Values: Horizontal, Vertical.
Ui ScrollAreaUi Per-instance class overrides of the slots of the scroll area, see ScrollAreaUi . They are merged after the theme and the Class parameter wins on the root slot.

Slots

Name Type Description
ChildContent RenderFragment Content of the scroll area.

Ui slots

Ui takes a ScrollAreaUi with one class string per slot, merged after the theme.

Slot Styles
Root Classes merged into the root slot of KlyScrollArea , after the theme and the app configuration.
Viewport Classes merged into the viewport slot of KlyScrollArea , after the theme and the app configuration.