- Prop
axis- Type
"horizontal" | "vertical" | "both" | undefined- Default
"vertical"- Requirement
- optional
- Description
- Scroll axis.
Docs Components Primitives
ScrollArea
React example follows below.
Vue example follows below.
Angular example follows below.
Svelte example follows below.
Solid example follows below.
- parts
- —
- nodes
- —
- size
- —
- part
- —
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> );}- parts
- —
- nodes
- —
- size
- —
- part
- —
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>- parts
- —
- nodes
- —
- size
- —
- part
- —
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;- parts
- —
- nodes
- —
- size
- —
- part
- —
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>- parts
- —
- nodes
- —
- size
- —
- part
- —
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.
maxHeightstring | number | undefined168optional
Caps the box; number → px.
- 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" | undefinedscrollAreaDefaults.axisoptional
maxHeightstring | number | undefined() => scrollAreaDefaults.maxHeightoptional
- 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.axisoptional
maxHeightnumber | stringscrollAreaDefaults.maxHeightoptional
- 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
maxHeightnumber | string—
optional
classNamestring—
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
maxHeightnumber | string—
optional
classNamestring—
optional
styleJSX.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.