Skip to main content

Scroll Area

Shared, editable XML components from the scroll-area family.

Usage​

Declare the catalog namespace in your screen and run relo-components build to bundle its dependencies before delivery. Install Components host support before session creation. Use ui:Theme or your compatible theme.

<ui:Theme xmlns:ui="urn:relo:registry:relo">
<ui:ScrollArea />
</ui:Theme>

Dependencies: theme.

Exports​

ui:ScrollArea · ui:ScrollBar

ui:ScrollArea​

PropDefaultRequired
axis'vertical'No
label'Scroll area'No

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Events​

No directly emitted output events.

Slots​

  • default — caller children.
Definition and forwarded payloads
<Component name="ScrollArea" props="axis='vertical', label='Scroll area'" xmlns:ui="urn:relo:registry:relo">
<Overlay state="{metrics:{offset:0,content:1,viewport:1}}" class="justify-end items-end">
<Scroll ref="viewport" bind-axis="props.axis" bind-label="props.label" indicators="false" class="w-full h-full" on-scroll.latest="set metrics to event">
<Column class="gap-2">
<Slot />
</Column>
</Scroll>
<ui:ScrollBar if="metrics.content &gt; metrics.viewport" bind-axis="props.axis" bind-value="metrics.offset / (metrics.content - metrics.viewport)" bind-thumbFraction="metrics.viewport / metrics.content" on-change="if props.axis == 'vertical' then call refs.viewport.scrollTo with {y:event.value*(metrics.content-metrics.viewport)} into result else call refs.viewport.scrollTo with {x:event.value*(metrics.content-metrics.viewport)} into result end" />
</Overlay>
</Component>

Read ScrollArea source.

ui:ScrollBar​

PropDefaultRequired
axis'vertical'No
value0No
thumbFraction1No
label'Scroll position'No

Template signatures declare names and defaults, not static types. Values must satisfy the underlying primitive or service. Defaults preserve the exact source expression; the definition below shows how inputs are used. Use literal strings or bind-* for evaluated values. Unknown inputs and missing required props fail validation.

Mapped axis choices: horizontal, vertical.

Events​

  • on-change — explicitly emitted output; inspect the definition for payload shape.

Slots​

No content outlets.

Definition and forwarded payloads
<Component name="ScrollBar" props="axis='vertical', value=0, thumbFraction=1, label='Scroll position'">
<Scrollbar bind-axis="props.axis" bind-value="props.value" bind-thumbFraction="props.thumbFraction" bind-label="props.label" bind-class="'transition-value spring-fast ' + ({vertical:'w-11 h-full',horizontal:'h-11 w-full'}[props.axis] + ' text-rc-border rounded-full')" on-change="emit change with event" />
</Component>

Read ScrollBar source.

Composition and accessibility​

Use explicit value/change ownership; events do not bubble automatically. A component forwards only outputs declared by its own emits. Slots retain caller scope. Supply meaningful labels for interactive controls, preserve focus and touch targets, and test reduced motion on each platform.

Component customization · Definitions and slots · Components index