Loading...
Loading...
> A collection of loading components including spinners, skeletons, and loading states for buttons and containers.
1import { Spinner, Skeleton, LoadingContainer, LoadingButton } from "@/components/ui/loading"
1<Spinner />
1<Spinner variant="braille" /> {/* default */}2<Spinner variant="line" />3<Spinner variant="block" />4<Spinner variant="dots" />
1<Spinner size="sm" />2<Spinner size="md" />3<Spinner size="lg" />
1<div className="space-y-2 w-full">2 <Skeleton variant="text" />3 <Skeleton variant="text" className="w-3/4" />4 <Skeleton variant="text" className="w-1/2" />5</div>
1<div className="flex items-center gap-4">2 <Skeleton variant="circular" className="h-12 w-12" />3 <Skeleton variant="circular" className="h-16 w-16" />4 <Skeleton variant="circular" className="h-20 w-20" />5</div>
1<div className="space-y-4 w-full">2 <Skeleton variant="rectangular" className="h-32 w-full" />3 <Skeleton variant="rectangular" className="h-48 w-full" />4</div>
Loading your content...
1<LoadingContainer>2 Loading your content...3</LoadingContainer>
1const [loading, setLoading] = useState(false);23const handleClick = () => {4 setLoading(true);5 setTimeout(() => setLoading(false), 2000);6};78<LoadingButton9 loading={loading}10 onClick={handleClick}11 loadingText="Saving..."12>13 Save Changes14</LoadingButton>
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "sm" | "md" | "lg" | "md" | The size of the spinner (Spinner component only). |
| variant | "text" | "circular" | "rectangular" | "text" | The shape variant of the skeleton (Skeleton component only). |
| loading | boolean | false | Whether the button is in loading state (LoadingButton only). |
| loadingText | string | - | Text to display when button is loading (LoadingButton only). |
| className | string | - | Additional CSS classes to apply to the component. |