Scroll bar
⋯
The Figma Scroll Bar is a CSS class, not a React component. Add scrollbar-nesra to any element
that scrolls. It styles both the vertical and the horizontal bar.
<div className="scrollbar-nesra h-64 overflow-y-auto">…</div>The class ships in @nesra/ui/styles. It needs no Tailwind @source entry.
Example
Section titled “Example”const rows = Array.from({ length: 24 }, (_, index) => `Campaign ${index + 1}`);
export function ScrollBarExample() { return ( <div className="grid gap-6 sm:grid-cols-2"> <ul aria-label="Campaigns" className="scrollbar-nesra m-0 h-48 list-none overflow-y-auto rounded-nesra-md border border-nesra-stroke-border p-0" // A scroll container without focusable children must be focusable to scroll by keyboard. // oxlint-disable-next-line jsx-a11y/no-noninteractive-tabindex tabIndex={0} > {rows.map((row) => ( <li className="border-b border-nesra-stroke-divider px-3 py-2 type-nesra-body-small-regular text-nesra-text-body last:border-b-0" key={row} > {row} </li> ))} </ul> <section aria-label="Campaign timeline" className="scrollbar-nesra self-start overflow-x-auto rounded-nesra-md border border-nesra-stroke-border" // oxlint-disable-next-line jsx-a11y/no-noninteractive-tabindex tabIndex={0} > <div className="flex w-[64rem] gap-2 p-3"> {rows.slice(0, 12).map((row) => ( <span className="shrink-0 rounded-nesra-sm bg-nesra-surface-card-bg-gray px-3 py-2 type-nesra-body-small-medium text-nesra-text-body" key={row} > {row} </span> ))} </div> </section> </div> );}Figma mapping
Section titled “Figma mapping”Figma Scroll Bar has Orientation=Vertical and Orientation=Horizontal. Both use the same values.
| Part | Figma value | CSS |
|---|---|---|
| Track | 14px thick | --nesra-unit-6 |
| Track | Surface/card-bg-gray, radius-full |
--nesra-surface-card-bg-gray, --nesra-radius-full |
| Thumb | 6px thick, inset spacing-xs (4px) each side |
4px transparent border on the 14px thumb (--nesra-spacing-xs) |
| Thumb | Icon/icon-disabled, radius-full |
--nesra-icon-disabled, --nesra-radius-full |
Both color roles have Light and Dark values. The bars were checked in both modes.
Behavior that Figma does not define
Section titled “Behavior that Figma does not define”- Hover. Figma has no hover state. The thumb changes to
--nesra-icon-mutedon hover. - Corner. Figma has no corner where two bars meet. The corner is transparent.
- Thumb length. Figma draws a 200px thumb. The browser sets the thumb length from the content size.
Browser support
Section titled “Browser support”- Chromium and Safari draw the exact Figma sizes through
::-webkit-scrollbar. - Firefox supports only
scrollbar-widthandscrollbar-color. It draws its own thin bar with the same thumb and track colors, but not the Figma sizes.
Accessibility
Section titled “Accessibility”The class changes appearance only. A scroll container that holds no focusable content needs
tabIndex={0} and an accessible name so keyboard users can scroll it, as in the example.