ScrollFrame
Radix-backed scroll frames with reliable plumbing, eased edge fades, hidden or visible scrollbars, and overflow-aware movement controls.
Install
npm install @patternmode/scrollframeimport { ScrollFrame } from "@patternmode/scrollframe";
import "@patternmode/scrollframe/styles.css";
function ActivityPanel() {
return (
<ScrollFrame aria-label="Activity" fadeColor="var(--surface)">
{items.map((item) => (
<ActivityRow key={item.id} item={item} />
))}
</ScrollFrame>
);
}Core API
ScrollFrame
Radix-based scroll container with measured fades and movement controls.
axes- "vertical" | "horizontal" | "both""vertical"Chooses the supported scroll axes.
fades- boolean | "none" | "start" | "end" | "both" | AxisFadeConfigtrueControls measured eased edge fades.
fadeColor- stringCSS color used by the fade overlays.
fadeSize- number | stringSize of the fade overlay along the scroll axis.
scrollbars- "auto" | "always" | "hover" | "hidden""auto"Controls scrollbar visibility while keeping Radix scroll plumbing mounted.
controls- boolean | ScrollFrameControlsConfigfalseAdds overflow-aware previous and next movement controls.
scrollStep- "page" | number | ((state, axis) => number)"page"Controls movement distance for previous and next controls.