Tags
Shadcn's list, with a pencil scroll mark instead of a bar. The mark fades in when the pointer is over the area or it scrolls, and the thumb is a graphite pull that slides down a faint gutter.
A scroll container whose bar is a pencil "scroll mark": a graphite pull sliding down a faint gutter, gone over once more when a hand is on it. It fades in on hover or scroll, works in both directions, and is Radix underneath.
npx shadcn@latest add @wobko/scroll-areaFirst time here? Add the registry to components.json first. How to install
Shadcn's list, with a pencil scroll mark instead of a bar. The mark fades in when the pointer is over the area or it scrolls, and the thumb is a graphite pull that slides down a faint gutter.
`orientation="horizontal"` shows only the horizontal mark. `bleed` pads the viewport by 12 px so the notes' shadows and any focus ring are not cut at the edge of the strip.
`orientation="both"` shows both marks (here `type="always"`, so they stay in view); the corner where they meet stays empty. A scroll container with nothing focusable inside is reachable by keyboard in current browsers; the viewport draws a blue ring inside its edge when it has focus.
A real screen: a fixed-height log inside a card, with the newest line kept in view, `bleed` so the edge buttons keep their rings, and an input below. The scroll mark shows while the log is being scrolled.
Official `scroll-area-demo`: fifty version tags with a Separator between each. The box is a dashed pencil edge rather than `rounded-md border`, and the scroll mark is a graphite pull in a faint gutter. Scroll with the wheel, drag the mark, or focus the list and use the arrow keys.
Official `scroll-area-horizontal-demo`: a strip of figures that scrolls sideways under an explicit `ScrollBar orientation="horizontal"`. shadcn shows three stock photographs; here they are polaroids of drawn scenes, so nothing is fetched. `bleed` gives the viewport 12 px so the photos' shadows are not cut at the edge.
The Radix Scroll Area root with its viewport, a vertical mark and the corner. The root clips (that is how scrolling works): use `bleed` when children draw beyond their own box.
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | "vertical" | "horizontal" | "both" | "vertical" | Which marks to mount. Upstream always mounts the vertical one and lets you add `<ScrollBar orientation="horizontal" />` as a child; that still works. With `vertical` the content wrapper Radix adds is an ordinary block (Radix makes it `display: table`, as wide as the widest unbreakable line, so a `truncate` title in a list of cards pushed the cards out of the box); `horizontal` and `both` keep the table so a row of max-content width overflows and scrolls. A sideways row inside a `vertical` area needs a width of its own (`w-max`). |
| bleed | boolean | false | Pad the viewport by 12 px so a child's focus ring, shadow or ink bleed is not cut at the edge of the scroll area. |
| type | "auto" | "always" | "scroll" | "hover" | "hover" | When the mark shows (Radix): on hover or scroll, whenever there is overflow, only while scrolling, or always. |
| scrollHideDelay | number | 600 | How long the mark lingers after the pointer leaves (ms). |
The gutter and its thumb, each its own small drawing. The thumb's length follows the content; a thumb over 44 px gets two short cross-strokes at its middle.
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | "vertical" | "horizontal" | "vertical" | Which edge it lives on. |
| seed | string | number | - | Pins the hand. Default: derived from useId(). |
The files the CLI copies into your project.
Loading the source