Download web/src/ui/OverlayScroll.tsx from fsanyoto/loopable: direct link, hf CLI and curl.
- Browser
- Download file 592 Bytes
-
https://huggingface.co/spaces/fsanyoto/loopable/resolve/main/web/src/ui/OverlayScroll.tsx
- Command line
-
hf download hf://spaces/fsanyoto/loopable/web/src/ui/OverlayScroll.tsx
-
curl -L -o OverlayScroll.tsx https://huggingface.co/spaces/fsanyoto/loopable/resolve/main/web/src/ui/OverlayScroll.tsx
592 Bytes
| import { createElement, forwardRef, type HTMLAttributes } from "react"; | |
| type ScrollElement = "div" | "aside" | "nav"; | |
| type OverlayScrollProps = HTMLAttributes<HTMLElement> & { element?: ScrollElement }; | |
| // Keep the name so the three mounts stay put; R11 retired the overlay in favour of native scrolling. | |
| export const OverlayScroll = forwardRef<HTMLElement, OverlayScrollProps>(function OverlayScroll( | |
| { element = "div", className, children, ...props }, ref, | |
| ) { | |
| return createElement( | |
| element, | |
| { ...props, className, ref, tabIndex: props.tabIndex ?? 0 }, | |
| children, | |
| ); | |
| }); | |