Repository: SameerJS6/lina Branch: main Commit: 6c1934820003 Files: 86 Total size: 208.3 KB Directory structure: gitextract_dybf963_/ ├── .gitignore ├── .prettierignore ├── .prettierrc.json ├── .vscode/ │ └── settings.json ├── LICENSE ├── README.md ├── app/ │ ├── globals.css │ ├── layout.tsx │ ├── manifest.ts │ ├── page.tsx │ ├── robots.ts │ └── sitemap.ts ├── components/ │ ├── adaptive-mask.tsx │ ├── anchor-heading.tsx │ ├── cli-block.tsx │ ├── code-block.tsx │ ├── code-display-block.tsx │ ├── component-preview.tsx │ ├── copy-button.tsx │ ├── examples.tsx │ ├── features.tsx │ ├── installation.tsx │ ├── manual-installation-block.tsx │ ├── micro-interactions.tsx │ ├── native-touch.tsx │ ├── navbar.tsx │ ├── page-wide-scroll-mask.tsx │ ├── posthog-provider.tsx │ ├── render-preview.tsx │ ├── theme-provider.tsx │ ├── theme-toggle.tsx │ ├── ui/ │ │ ├── button.tsx │ │ ├── card.tsx │ │ ├── dialog.tsx │ │ ├── label.tsx │ │ ├── popover.tsx │ │ ├── revola.tsx │ │ ├── select.tsx │ │ ├── separator.tsx │ │ ├── skeleton.tsx │ │ ├── tabs.tsx │ │ └── tooltip.tsx │ ├── usage.tsx │ ├── variant-select.tsx │ └── why.tsx ├── components.json ├── eslint.config.mjs ├── hooks/ │ ├── use-copy-button.ts │ ├── use-has-primary-touch.tsx │ ├── use-media-query.tsx │ └── use-meta-color.ts ├── lib/ │ ├── adaptive-mask-animation.ts │ ├── code-highlight.ts │ ├── package-manager-store.ts │ ├── package-manager-utils.ts │ ├── utils.ts │ └── variant-store.ts ├── next.config.ts ├── package.json ├── postcss.config.mjs ├── public/ │ ├── r/ │ │ ├── command-base.json │ │ ├── command-radix.json │ │ ├── horizontal-scroll-demo-base.json │ │ ├── horizontal-scroll-demo-radix.json │ │ ├── lina-base.json │ │ ├── lina-radix.json │ │ ├── timezone-select-demo-base.json │ │ ├── timezone-select-demo-radix.json │ │ ├── vertical-scroll-demo-base.json │ │ └── vertical-scroll-demo-radix.json │ └── site.webmanifest ├── registry/ │ ├── base-ui/ │ │ ├── examples/ │ │ │ ├── command.tsx │ │ │ ├── horizontal-scroll.tsx │ │ │ ├── timezone-select.tsx │ │ │ ├── usage-demo.tsx │ │ │ └── vertical-scroll.tsx │ │ └── scroll-area.tsx │ ├── radix-ui/ │ │ ├── examples/ │ │ │ ├── command.tsx │ │ │ ├── horizontal-scroll.tsx │ │ │ ├── timezone-select.tsx │ │ │ ├── usage-demo.tsx │ │ │ └── vertical-scroll.tsx │ │ └── scroll-area.tsx │ └── registry.ts ├── registry.json └── tsconfig.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies /node_modules /.pnp .pnp.* .yarn/* !.yarn/patches !.yarn/plugins !.yarn/releases !.yarn/versions # testing /coverage # next.js /.next/ /out/ # production /build # misc .DS_Store *.pem # debug npm-debug.log* yarn-debug.log* yarn-error.log* .pnpm-debug.log* # env files (can opt-in for committing if needed) .env* # vercel .vercel # typescript *.tsbuildinfo next-env.d.ts ================================================ FILE: .prettierignore ================================================ .next package-lock.json pnpm-lock.yaml components.json ================================================ FILE: .prettierrc.json ================================================ { "semi": true, "singleQuote": false, "tabWidth": 2, "printWidth": 120, "bracketSpacing": true, "trailingComma": "es5", "endOfLine": "auto", "plugins": ["@ianvs/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"], "importOrder": [ "^(react/(.*)$)|^(react$)", "^(next/(.*)$)|^(next$)", "", "", "^@base-ui-components/(.*)$", "^@radix-ui/(.*)$", "^cmdk$", "^lucide-react$", "^motion$", "^next-themes$", "^posthog-js$", "^posthog-js/(.*)$", "^vaul$", "^zustand$", "^class-variance-authority$", "^clsx$", "^tailwind-merge$", "", "^@/app/(.*)$", "^@/components/(.*)$", "", "^@/components/ui/(.*)$", "^@/lib/(.*)$", "", "^@/hooks/(.*)$", "", "^[./]" ], "importOrderParserPlugins": ["typescript", "jsx", "decorators-legacy"], "importOrderTypeScriptVersion": "5.0.0", "importOrderCaseSensitive": false, "importOrderSeparation": true, "importOrderSortSpecifiers": true, "importOrderGroupNamespaceSpecifiers": true } ================================================ FILE: .vscode/settings.json ================================================ { "typescript.tsdk": "node_modules\\typescript\\lib", "typescript.preferences.importModuleSpecifier": "non-relative", "javascript.preferences.importModuleSpecifier": "non-relative", "typescript.updateImportsOnFileMove.enabled": "always", "javascript.updateImportsOnFileMove.enabled": "always", "typescript.tsserver.experimental.enableProjectDiagnostics": true, "typescript.preferences.importModuleSpecifierEnding": "minimal", "javascript.preferences.importModuleSpecifierEnding": "minimal", "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.codeActionsOnSave": { "source.removeUnusedImports": "explicit" } } ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2025 Sameer Singh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # Lina The Adaptive Scroll Area for Modern UIs A responsive scroll area that feels native on touch devices, offering custom styling and enhanced interactions where it matters most. Lina is a drop‑in replacement for shadcn/ui's `ScrollArea` with better defaults and a more native feel. ![](/main-mockup.png) ## Features - **Adaptive mask** - Subtle edge fades appear only when content is scrollable and adapt in real time to scroll position, axis, and container shape. - **Micro‑interactions** - Hover/press effects for the custom scrollbar on non‑touch (desktop) devices, with responsive thumb behavior. - **Native touch optimization** - Uses the right touch‑action, momentum scrolling, and passive listeners so scrolling feels truly native on iOS/Android while staying precise on desktop. - **Drop‑in replacement** - Matches shadcn/ui's `ScrollArea` API, same props, slots, and `className` ergonomics—so you can swap it in with zero extra step. - **Radix and Base UI variants** - Choose Radix or Base UI primitives while keeping a consistent API and visual design. ## Installation ```bash npx shadcn@latest add https://lina.sameer.sh/r/lina-radix.json ``` ## Usage ```tsx import { ScrollArea } from "@/components/ui/scroll-area"; export default function Example() { return ( Jokester began sneaking into the castle in the middle of the night and leaving jokes all over the place: under the king's pillow, in his soup, even in the royal toilet. The king was furious, but he couldn't seem to stop Jokester. And then, one day, the people of the kingdom discovered that the jokes left by Jokester were so funny that they couldn't help but laugh. And once they started laughing, they couldn't stop. ); } ``` ## Documentation Visit [Docs](https://lina.sameer.sh) ## Credits Built on top of: - [Radix UI's Scroll Area](https://radix-ui.com/primitives/docs/components/scroll-area) by [Radix UI](https://radix-ui.com) - [Base UI's Scroll Area](https://base-ui.com/react/components/scroll-area) by [Base UI](https://base-ui.com/) ## License MIT ================================================ FILE: app/globals.css ================================================ @import "tailwindcss"; @import "tw-animate-css"; @custom-variant dark (&:is(.dark *)); @theme inline { --breakpoint-3xl: 1600px; --breakpoint-4xl: 2000px; --color-background: var(--background); --color-foreground: var(--foreground); --font-sans: var(--font-geist-sans); --font-mono: var(--font-geist-mono); --font-inter: var(--font-inter); --color-primary: var(--primary); --color-primary-foreground: var(--primary-foreground); --color-secondary: var(--secondary); --color-secondary-foreground: var(--secondary-foreground); --color-card: var(--card); --color-card-foreground: var(--card-foreground); --color-popover: var(--popover); --color-popover-foreground: var(--popover-foreground); --color-muted: var(--muted); --color-muted-foreground: var(--muted-foreground); --color-accent: var(--accent); --color-accent-foreground: var(--accent-foreground); --color-surface: var(--surface); --color-surface-foreground: var(--surface-foreground); --color-ring: var(--ring); --color-input: var(--input); --color-border: var(--border); --color-destructive: var(--destructive); --radius-sm: calc(var(--radius) - 4px); --radius-md: calc(var(--radius) - 2px); --radius-lg: var(--radius); --radius-xl: calc(var(--radius) + 4px); } :root { --radius: 0.625rem; --background: oklch(1 0 0); --foreground: oklch(0.141 0.005 285.823); --primary: oklch(0.21 0.006 285.885); --primary-foreground: oklch(0.985 0 0); --secondary: oklch(0.967 0.001 286.375); --secondary-foreground: oklch(0.21 0.006 285.885); --card: oklch(1 0 0); --card-foreground: oklch(0.141 0.005 285.823); --popover: oklch(1 0 0); --popover-foreground: oklch(0.141 0.005 285.823); --muted: oklch(0.967 0.001 286.375); --muted-foreground: oklch(0.552 0.016 285.938); --accent: oklch(0.967 0.001 286.375); --accent-foreground: oklch(0.21 0.006 285.885); --surface: oklch(0.98 0 0); --surface-foreground: var(--foreground); --destructive: oklch(0.577 0.245 27.325); --border: oklch(0.92 0.004 286.32); --input: oklch(0.92 0.004 286.32); --ring: oklch(0.705 0.015 286.067); } .dark { --background: oklch(0.141 0.005 285.823); --foreground: oklch(0.985 0 0); --primary: oklch(0.92 0.004 286.32); --primary-foreground: oklch(0.21 0.006 285.885); --secondary: oklch(0.274 0.006 286.033); --secondary-foreground: oklch(0.985 0 0); --card: oklch(0.21 0.006 285.885); --card-foreground: oklch(0.985 0 0); --popover: oklch(0.21 0.006 285.885); --popover-foreground: oklch(0.985 0 0); --muted: oklch(0.274 0.006 286.033); --muted-foreground: oklch(0.705 0.015 286.067); --accent: oklch(0.274 0.006 286.033); --accent-foreground: oklch(0.985 0 0); --surface: oklch(0.2 0 0); --surface-foreground: oklch(0.708 0 0); --destructive: oklch(0.704 0.191 22.216); --border: oklch(1 0 0 / 10%); --input: oklch(1 0 0 / 15%); --ring: oklch(0.552 0.016 285.938); } @layer base { * { scrollbar-width: thin; scrollbar-color: var(--border) transparent; @apply border-border outline-ring/50; } html { @apply scroll-smooth; } body { @apply bg-background selection:bg-primary selection:text-primary-foreground text-foreground font-sans; font-synthesis-weight: none; text-rendering: optimizeLegibility; } img { @apply select-none; } } @utility container { @apply 3xl:max-w-screen-2xl mx-auto max-w-[1400px] px-4 lg:px-8; } @utility focus-ring { @apply focus-visible:border-ring focus-visible:ring-ring/50 outline-none focus-visible:ring-[3px]; } @layer components { [data-line-numbers] { display: grid; min-width: 100%; white-space: pre; border: 0; background: transparent; padding: 0; counter-reset: line; box-decoration-break: clone; } [data-line-numbers] [data-line]::before { font-size: var(--text-sm); counter-increment: line; content: counter(line); display: inline-block; width: calc(var(--spacing) * 16); padding-right: calc(var(--spacing) * 6); text-align: right; color: var(--color-foreground); background-color: var(--color-surface); position: sticky; left: 0; } [data-line] { padding-top: calc(var(--spacing) * 0.5); padding-bottom: calc(var(--spacing) * 0.5); min-height: calc(var(--spacing) * 1); width: 100%; display: inline-block; } [data-line] span { color: var(--shiki-light); @apply selection:bg-primary/10 selection:text-(--shiki-light) dark:selection:text-(--shiki-dark); @variant dark { color: var(--shiki-dark) !important; } } [data-highlighted-line] { &:after { position: absolute; top: 0; left: 0; width: 2px; height: 100%; content: ""; background-color: var(--border); } } } /* Custom Scrollbar Styling */ ::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-track { width: 10px; margin-block: 0.25rem; background: var(--background); } ::-webkit-scrollbar-thumb { border-radius: 100vw; background: color-mix(in oklab, var(--primary) 25%, transparent); transition: background 0.15s ease-in-out; &:hover { background: color-mix(in oklab, var(--primary) 30%, transparent); } &:active { background: color-mix(in oklab, var(--primary) 50%, transparent); } } ================================================ FILE: app/layout.tsx ================================================ import type { Metadata } from "next"; import { Geist, Geist_Mono, Inter } from "next/font/google"; import "@/app/globals.css"; import Navbar from "@/components/navbar"; import PostHogProvider from "@/components/posthog-provider"; import { ThemeProvider } from "@/components/theme-provider"; import { META_THEME_COLORS } from "@/hooks/use-meta-color"; const geistSans = Geist({ variable: "--font-geist-sans", subsets: ["latin"], }); const geistMono = Geist_Mono({ variable: "--font-geist-mono", subsets: ["latin"], }); const inter = Inter({ variable: "--font-inter", subsets: ["latin"], }); export const metadata: Metadata = { title: "Refined & Responsive Scroll Area - Lina", description: "A responsive scroll area that feels native on touch, and custom where it matters.", keywords: [ "radix ui", "Next.js", "React", "Tailwind CSS", "Components", "shadcn", "scroll-area", "ScrollArea", "base ui", "adaptive", "responsive", ], creator: "SameerJS6", authors: [ { name: "SameerJS6", url: "https://sameer.sh", }, ], openGraph: { title: "Refined & Responsive Scroll Area - Lina", description: "A responsive scroll area that feels native on touch, and custom where it matters.", type: "website", url: process.env.NEXT_PUBLIC_BASE_URL, images: [ { url: `${process.env.NEXT_PUBLIC_BASE_URL}/og-image.png`, width: 1280, height: 630, alt: "Lina", }, ], }, twitter: { card: "summary_large_image", title: "Refined & Responsive Scroll Area - Lina", description: "A responsive scroll area that feels native on touch, and custom where it matters.", images: [`${process.env.NEXT_PUBLIC_BASE_URL}/og-image.png`], creator: "@sameerjs6", }, alternates: { canonical: process.env.NEXT_PUBLIC_BASE_URL, }, manifest: `${process.env.NEXT_PUBLIC_BASE_URL}/site.webmanifest`, }; export default function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { return (