Docs Components Primitives

ScrollArea

React example follows below.
ts
const scrollAreaFixture = {
id: "scroll-area",
items: [
{ name: "ledger-api", latency: "142ms" },
{ name: "billing-worker", latency: "88ms" },
{ name: "edge-gateway", latency: "31ms" },
{ name: "analytics-ingest", latency: "503ms" },
{ name: "scheduler", latency: "61ms" },
{ name: "notify-svc", latency: "44ms" },
],
} satisfies { id: string; items: Array<{ name: string; latency: string }> };
import { ScrollArea } from "@grassroot/ui-react";
export default function ScrollAreaDemo() {
return (
<div>
<ScrollArea maxHeight={168} className="w-full max-w-[340px]">
{scrollAreaFixture.items.map((item) => (
<div
key={item.name}
className="flex items-center justify-between border-b border-line px-[14px] py-2.5 text-[14px] text-body"
>
{item.name}
<span className="font-mono text-[11.5px] text-muted">{item.latency}</span>
</div>
))}
</ScrollArea>
</div>
);
}
ts
<script setup lang="ts">
const scrollAreaFixture = {
id: "scroll-area",
items: [
{ name: "ledger-api", latency: "142ms" },
{ name: "billing-worker", latency: "88ms" },
{ name: "edge-gateway", latency: "31ms" },
{ name: "analytics-ingest", latency: "503ms" },
{ name: "scheduler", latency: "61ms" },
{ name: "notify-svc", latency: "44ms" },
],
} satisfies { id: string; items: Array<{ name: string; latency: string }> };
import { ScrollArea } from "@grassroot/ui-vue";
</script>
<template>
<div>
<ScrollArea :max-height="168" class="w-full max-w-[340px]">
<div
v-for="item in scrollAreaFixture.items"
:key="item.name"
class="flex items-center justify-between border-b border-line px-[14px] py-2.5 text-[14px] text-body"
>
{{ item.name }}
<span class="font-mono text-[11.5px] text-muted">{{ item.latency }}</span>
</div>
</ScrollArea>
</div>
</template>
ts
import { Component } from "@angular/core";
const scrollAreaFixture = {
id: "scroll-area",
items: [
{ name: "ledger-api", latency: "142ms" },
{ name: "billing-worker", latency: "88ms" },
{ name: "edge-gateway", latency: "31ms" },
{ name: "analytics-ingest", latency: "503ms" },
{ name: "scheduler", latency: "61ms" },
{ name: "notify-svc", latency: "44ms" },
],
} satisfies { id: string; items: Array<{ name: string; latency: string }> };
import { GrassrootScrollArea } from "@grassroot/ui-angular";
@Component({
selector: "app-scroll-area-demo",
standalone: true,
imports: [GrassrootScrollArea],
template: `
<div>
<grassroot-scroll-area [maxHeight]="168" class="w-full max-w-[340px]">
@for (item of fixture.items; track item.name) {
<div
class="flex items-center justify-between border-b border-line px-[14px] py-2.5 text-[14px] text-body"
>
{{ item.name }}
<span class="font-mono text-[11.5px] text-muted">{{ item.latency }}</span>
</div>
}
</grassroot-scroll-area>
</div>
`,
})
export class ScrollAreaDemoComponent {
protected readonly fixture = scrollAreaFixture;
}
export default ScrollAreaDemoComponent;
ts
<script lang="ts">
import { ScrollArea } from "@grassroot/ui-svelte";
const scrollAreaFixture = {
id: "scroll-area",
items: [
{ name: "ledger-api", latency: "142ms" },
{ name: "billing-worker", latency: "88ms" },
{ name: "edge-gateway", latency: "31ms" },
{ name: "analytics-ingest", latency: "503ms" },
{ name: "scheduler", latency: "61ms" },
{ name: "notify-svc", latency: "44ms" },
],
} satisfies { id: string; items: Array<{ name: string; latency: string }> };
</script>
<div>
<ScrollArea maxHeight={168} className="w-full max-w-[340px]">
{#each scrollAreaFixture.items as item (item.name)}
<div
class="flex items-center justify-between border-b border-line px-[14px] py-2.5 text-[14px] text-body"
>
{item.name}
<span class="font-mono text-[11.5px] text-muted">{item.latency}</span>
</div>
{/each}
</ScrollArea>
</div>
ts
/** @jsxImportSource solid-js */
import { ScrollArea } from "@grassroot/ui-solid";
const scrollAreaFixture = {
id: "scroll-area",
items: [
{ name: "ledger-api", latency: "142ms" },
{ name: "billing-worker", latency: "88ms" },
{ name: "edge-gateway", latency: "31ms" },
{ name: "analytics-ingest", latency: "503ms" },
{ name: "scheduler", latency: "61ms" },
{ name: "notify-svc", latency: "44ms" },
],
} satisfies { id: string; items: Array<{ name: string; latency: string }> };
export default function ScrollAreaDemo() {
return (
<div>
<ScrollArea maxHeight={168} className="w-full max-w-[340px]">
{scrollAreaFixture.items.map((item) => (
<div class="flex items-center justify-between border-b border-line px-[14px] py-2.5 text-[14px] text-body">
{item.name}
<span class="font-mono text-[11.5px] text-muted">{item.latency}</span>
</div>
))}
</ScrollArea>
</div>
);
}

Installation

API Reference

Import

import { ScrollArea } from "@grassroot/ui-react";

Props

Prop
Type
Default
Requirement
Description
axis
"horizontal" | "vertical" | "both" | undefined
"vertical"
optional
Scroll axis.
maxHeight
string | number | undefined
168
optional
Caps the box; number → px.
Prop
axis
Type
"horizontal" | "vertical" | "both" | undefined
Default
"vertical"
Requirement
optional
Description
Scroll axis.
Prop
maxHeight
Type
string | number | undefined
Default
168
Requirement
optional
Description
Caps the box; number → px.

Content regions

  • children

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.

Import

import { ScrollArea } from "@grassroot/ui-vue";

Props

Prop
Type
Default
Requirement
axis
"vertical" | "horizontal" | "both" | undefined
scrollAreaDefaults.axis
optional
maxHeight
string | number | undefined
() => scrollAreaDefaults.maxHeight
optional
Prop
axis
Type
"vertical" | "horizontal" | "both" | undefined
Default
scrollAreaDefaults.axis
Requirement
optional
Prop
maxHeight
Type
string | number | undefined
Default
() => scrollAreaDefaults.maxHeight
Requirement
optional

Content regions

  • default

Import

import { Component } from "@angular/core";
import { GrassrootScrollArea } from "@grassroot/ui-angular";

Props

Prop
Type
Default
Requirement
axis
"vertical" | "horizontal" | "both"
scrollAreaDefaults.axis
optional
maxHeight
number | string
scrollAreaDefaults.maxHeight
optional
Prop
axis
Type
"vertical" | "horizontal" | "both"
Default
scrollAreaDefaults.axis
Requirement
optional
Prop
maxHeight
Type
number | string
Default
scrollAreaDefaults.maxHeight
Requirement
optional

Content regions

  • default

Import

import { ScrollArea } from "@grassroot/ui-svelte";

Props

Prop
Type
Default
Requirement
axis
"vertical" | "horizontal" | "both"
optional
maxHeight
number | string
optional
className
string
optional
Prop
axis
Type
"vertical" | "horizontal" | "both"
Default
Requirement
optional
Prop
maxHeight
Type
number | string
Default
Requirement
optional
Prop
className
Type
string
Default
Requirement
optional

Content regions

  • children

Import

import { ScrollArea } from "@grassroot/ui-solid";

Props

Prop
Type
Default
Requirement
axis
"vertical" | "horizontal" | "both"
optional
maxHeight
number | string
optional
className
string
optional
style
JSX.CSSProperties | string
optional
Prop
axis
Type
"vertical" | "horizontal" | "both"
Default
Requirement
optional
Prop
maxHeight
Type
number | string
Default
Requirement
optional
Prop
className
Type
string
Default
Requirement
optional
Prop
style
Type
JSX.CSSProperties | string
Default
Requirement
optional

Content regions

  • children

Native attributes

Standard DOM and ARIA attributes not listed above spread onto the root element.