Componentfeedback0.54 KB gzipZero dependencies
LoadingOverlay
Absolute/fixed veil with backdrop blur and spinner; fade in/out with opacity transition.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add loading-overlayOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { LoadingOverlay } from "@/components/ui/loading-overlay" <LoadingOverlay active={true} label="Loading data" />Source code
loading-overlay.tsx + 2 helpersZero third-party dependencies (3 local files shown in tabs below).
tsxloading-overlay.tsx56 lines
"use client"; import * as React from "react";import { lockBodyScroll } from "./lib/focus-trap";import { cn } from "./lib/utils"; export type LoadingOverlayProps = { active: boolean; label?: string;} & React.HTMLAttributes<HTMLElement>; export function LoadingOverlay({ active, label, ...props }: LoadingOverlayProps) { React.useEffect(() => { if (!active) return; return lockBodyScroll(); }, [active]); return (Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { LoadingOverlay } from "@/components/ui/loading-overlay"; <LoadingOverlay />| Prop | Type | Description |
|---|---|---|
| active | boolean | Whether the overlay is active. |
| label | string | Optional label text displayed above spinner. |