Scroll areaPro
Native scrolling with thin overlay scrollbars and edge fades that grow with what's left; Oxyn's stick-to-bottom follows a streaming transcript and offers Jump to latest when you scroll up.
oxyn add scroll-areaThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- Long transcripts, file lists and strips inside panels.
- Scrolling must stay native (momentum, keyboard, screen readers), with quieter bars and fades that say there is more.
When not to use
- The empty state of an AI app: use Starter prompts instead.
- Review an agent's change set: use Diff viewer instead.
- A dense card that gives itself more room on request: use Expandable card instead.
Installation
Scroll area is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add scroll-areaUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Transcript
Follows new lines; scroll up to let go.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
List
A file list with edge fades.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Strip
A horizontal strip that snaps.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
ScrollArea
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | String | "vertical" | `vertical` · `horizontal` · `both`. |
fade | f32 | 28.0 | Edge fade px (0 = off). |
scrollbars | String | "auto" | `auto` · `always` · `hidden`. |
hide_delay | u32 | 900 | Scrollbars linger ms. |
height | f32 | 240.0 | Viewport height px. |
width | f32 | 360.0 | Viewport width px. |
label | Option<String> | Default::default() | Accessible name (the viewport becomes a region). |
snap | Option<String> | Default::default() | `scroll-snap-type` for the viewport. |
stick_to_bottom | bool | Default::default() | Oxyn plus: follow new content. |
lines | Vec<Line> | Default::default() | Oxyn plus: transcript lines (with `stream`, appended one by one). |
stream | bool | Default::default() | Append a line every `stream_ms`. |
stream_ms | u32 | 1400 | Stream interval ms. |
children | Element | Default::default() | Static content. |
on_edge_change | EventHandler<(bool, bool, bool, bool)> | — | Edges changed (top, bottom, left, right). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Focus the viewport |
| ArrowsorPage UporDownorHomeorEndorSpace | Scroll natively |
Accessibility
- Scrolling stays native; with a label the viewport is a named region.
- The overlay bars are aria-hidden; the Jump to latest pill is a real button.
From the spec
Native scrolling is untouched: the viewport is focusable and keyboard-scrollable; with a label it is a named region. Bars are decorative; the pill is a real button.
Motion & interaction
Thumbs fade in while scrolling or on hover and fade out after hide_delay; under a fine pointer they thicken on hover. Edge fades grow with the distance left to each edge (capped at fade). New transcript lines rise in.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Bars in | 120 ms | linear | same |
| Bars out | 300 ms after hide_delay | linear | same |
| Thumb thicken | 120 ms | linear | none |
| Jump to latest | smooth scroll | native | instant |
Responsive behaviour
- Touch keeps native momentum; thumbs thicken only under a fine pointer.
Edge cases (spec)
Short content draws no bar and no fades. Very long content keeps a minimum thumb of 24 px. Touch keeps native momentum and overscroll containment.
Notes for AI
- Import
ScrollArea,Linefromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
ScrollAreaElinoxyn_gpui. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.