BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/lina/lina-radix

Radix Adaptive Scroll Area

lina/lina-radix
FreeComponent

A responsive scroll area that feels native on touch devices, offering custom styling and enhanced interactions where it matters most.

Install it

npx shadcn@latest add https://lina.sameer.sh/r/lina-radix.json

Source

registry/radix-ui/scroll-area.tsxlina.sameer.sh/r/lina-radix.json · first 6 KB
1"use client";
2
3import * as React from "react";
4
5import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
6
7import { cn } from "@/lib/utils";
8
9import { useTouchPrimary } from "@/hooks/use-has-primary-touch";
10
11const ScrollAreaContext = React.createContext<boolean>(false);
12type Mask = {
13 top: boolean;
14 bottom: boolean;
15 left: boolean;
16 right: boolean;
17};
18
19const ScrollArea = React.forwardRef<
20 React.ComponentRef<typeof ScrollAreaPrimitive.Root>,
21 React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> & {
22 viewportClassName?: string;
23 /**
24 * `maskHeight` is the height of the mask in pixels.
25 * pass `0` to disable the mask
26 * @default 30
27 */
28 maskHeight?: number;
29 maskClassName?: string;
30 }
31>(({ className, children, scrollHideDelay = 0, viewportClassName, maskClassName, maskHeight = 30, ...props }, ref) => {
32 const [showMask, setShowMask] = React.useState<Mask>({
33 top: false,
34 bottom: false,
35 left: false,
36 right: false,
37 });
38 const viewportRef = React.useRef<HTMLDivElement>(null);
39 const isTouch = useTouchPrimary();
40
41 const checkScrollability = React.useCallback(() => {
42 const element = viewportRef.current;
43 if (!element) return;
44
45 const { scrollTop, scrollLeft, scrollWidth, clientWidth, scrollHeight, clientHeight } = element;
46 setShowMask((prev) => ({
47 ...prev,
48 top: scrollTop > 0,
49 bottom: scrollTop + clientHeight < scrollHeight - 1,
50 left: scrollLeft > 0,
51 right: scrollLeft + clientWidth < scrollWidth - 1,
52 }));
53 }, []);
54
55 React.useEffect(() => {
56 if (typeof window === "undefined") return;
57
58 const element = viewportRef.current;
59 if (!element) return;
60
61 const controller = new AbortController();
62 const { signal } = controller;
63
64 const resizeObserver = new ResizeObserver(checkScrollability);
65 resizeObserver.observe(element);
66
67 element.addEventListener("scroll", checkScrollability, { signal });
68 window.addEventListener("resize", checkScrollability, { signal });
69
70 // Run an initial check whenever dependencies change (including pointer mode)
71 checkScrollability();
72
73 return () => {
74 controller.abort();
75 resizeObserver.disconnect();
76 };
77 }, [checkScrollability, isTouch]);
78
79 return (
80 <ScrollAreaContext.Provider value={isTouch}>
81 {isTouch ? (
82 <div
83 ref={ref}
84 role="group"
85// … truncated

What it pulls in

npm packages

  • @radix-ui/react-scroll-area

Files it writes

  • registry/radix-ui/scroll-area.tsx
  • hooks/use-has-primary-touch.tsx

Facts

Registry
lina
Type
registry:ui
Access
Free
Files written
2
Licence
MIT
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

lina.sameer.sh SameerJS6/lina on GitHub Raw registry item This item as JSON

More from lina

All 10 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Command based on Lina's Base UI variantcommand-baselinaComponentsFree2 deps
Command based on Lina's Radix UI variantcommand-radixlinaComponentsFree2 deps
Horizontal Scroll Area Base Demohorizontal-scroll-demo-baselinaComponentsFreeno deps
Horizontal Scroll Area Radix Demohorizontal-scroll-demo-radixlinaComponentsFreeno deps
Base UI Adaptive Scroll Arealina-baselinaComponentsFree1 dep · 2 files
Timezone Select Base UI Demotimezone-select-demo-baselinaComponentsFree1 dep
Timezone Select Radix Demotimezone-select-demo-radixlinaComponentsFree1 dep
Vertical Scroll Area Base Demovertical-scroll-demo-baselinaComponentsFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex