Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Get Started
Processing payment...
$100.00
import {
Item,
ItemContent,Installation
pnpm dlx shadcn@latest add spinner
Usage
import { Spinner } from "@/components/ui/spinner"<Spinner />Customization
You can replace the default spinner icon with any other icon by editing the Spinner component.
import { LoaderIcon } from "lucide-react"
import { cn } from "@/lib/utils"import { LoaderIcon } from "lucide-react"
import { cn } from "@/lib/utils"
function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
return (
<LoaderIcon
role="status"
aria-label="Loading"
className={cn("size-4 animate-spin", className)}
{...props}
/>
)
}
export { Spinner }Examples
Size
Use the size-* utility class to change the size of the spinner.
import { Spinner } from "@/components/ui/spinner"
export function SpinnerSize() {Button
Add a spinner to a button to indicate a loading state. Remember to use the data-icon="inline-start" prop to add the spinner to the start of the button and the data-icon="inline-end" prop to add the spinner to the end of the button.
import { Button } from "@/components/ui/button"
import { Spinner } from "@/components/ui/spinner"
Badge
Add a spinner to a badge to indicate a loading state. Remember to use the data-icon="inline-start" prop to add the spinner to the start of the badge and the data-icon="inline-end" prop to add the spinner to the end of the badge.
SyncingUpdatingProcessing
import { Badge } from "@/components/ui/badge"
import { Spinner } from "@/components/ui/spinner"
Input Group
Validating...
import {
InputGroup,
InputGroupAddon,Empty
Processing your request
Please wait while we process your request. Do not refresh the page.
import { Button } from "@/components/ui/button"
import {
Empty,RTL
To enable RTL support in shadcn/ui, see the RTL configuration guide.
جاري معالجة الدفع...
١٠٠.٠٠ دولار
"use client"
import * as React from "react"Deploy your shadcn/ui app on Vercel
Trusted by OpenAI, Sonos, Adobe, and more.
Vercel provides tools and infrastructure to deploy apps and features at scale.
Deploy to Vercel