{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "use-tab-bar-fade", "type": "registry:hook", "title": "useTabBarFade", "description": "Edge-fade masks for a horizontally overflowing tab strip; returns the CSS class to apply.", "categories": [ "hooks" ], "registryDependencies": [ "https://whiskeyjack.net/r/direction.json" ], "files": [ { "path": "hooks/use-tab-bar-fade.ts", "type": "registry:hook", "target": "hooks/use-tab-bar-fade.ts", "content": "import { useEffect, useState, type RefObject } from 'react'\nimport { isRTL } from '@/lib/direction'\n\nexport type FadeClass = '' | 'tab-bar-fade-left' | 'tab-bar-fade-right' | 'tab-bar-fade-both'\n\n/**\n * Tracks whether the given scroll container has overflow content to the\n * left, right, both, or neither. Returns the CSS class name to apply.\n *\n * Listens to scroll on the container, plus resize (window + ResizeObserver\n * on the container) so the class updates when the container size or its\n * children change.\n *\n * `changeKey` is an optional value that, when it changes, forces the\n * effect to re-run. Use this when the scroll container element is\n * conditionally rendered by a parent (e.g., `{tabs.length >= 2 &&