Spinner
Shows that something is loading. Inherits color and sizes with the surrounding text.
import { Badge } from "@/components/ui/badge";import { Button } from "@/components/ui/button";import { Spinner } from "@/components/ui/spinner";
export default function Demo() { return ( <div className="flex flex-wrap items-center gap-4"> <Spinner /> <Spinner className="size-6" /> <Button disabled variant="secondary"> <Spinner /> Deploying vault </Button> <Badge variant="brand"> <Spinner /> Rebalancing </Badge> </div> );}<script setup lang="ts">import { Badge } from "@/components/ui/badge";import { Button } from "@/components/ui/button";import { Spinner } from "@/components/ui/spinner";</script>
<template> <div class="flex flex-wrap items-center gap-4"> <Spinner /> <Spinner class="size-6" /> <Button disabled variant="secondary"> <Spinner /> Deploying vault </Button> <Badge variant="brand"> <Spinner /> Rebalancing </Badge> </div></template><script lang="ts"> import { Badge } from "$lib/components/ui/badge"; import { Button } from "$lib/components/ui/button"; import { Spinner } from "$lib/components/ui/spinner";</script>
<div class="flex flex-wrap items-center gap-4"> <Spinner /> <Spinner class="size-6" /> <Button disabled variant="secondary"> <Spinner /> Deploying vault </Button> <Badge variant="brand"> <Spinner /> Rebalancing </Badge></div>Installation
Section titled “Installation”npx shadcn@latest add @edmi-ui/spinnerpnpm dlx shadcn@latest add @edmi-ui/spinneryarn dlx shadcn@latest add @edmi-ui/spinnerbunx shadcn@latest add @edmi-ui/spinnerPick your package manager above; the choice is remembered. Add the @edmi-ui registry first, see Getting started.
Copy the code from Component source into your project and update the import paths to match your aliases.
npx shadcn-vue@latest add @edmi-ui/spinnerpnpm dlx shadcn-vue@latest add @edmi-ui/spinneryarn dlx shadcn-vue@latest add @edmi-ui/spinnerbunx shadcn-vue@latest add @edmi-ui/spinnerPick your package manager above; the choice is remembered. Add the @edmi-ui registry first, see Getting started.
Copy the code from Component source into your project and update the import paths to match your aliases.
npx shadcn-svelte@latest add https://viandwi24.github.io/edmi-ui/r/svelte/spinner.jsonpnpm dlx shadcn-svelte@latest add https://viandwi24.github.io/edmi-ui/r/svelte/spinner.jsonyarn dlx shadcn-svelte@latest add https://viandwi24.github.io/edmi-ui/r/svelte/spinner.jsonbunx --bun shadcn-svelte@latest add https://viandwi24.github.io/edmi-ui/r/svelte/spinner.jsonPick your package manager above; the choice is remembered. Add the @edmi-ui registry first, see Getting started.
Copy the code from Component source into your project and update the import paths to match your aliases.
import { Badge } from "@/components/ui/badge";import { Button } from "@/components/ui/button";import { Spinner } from "@/components/ui/spinner";
<div className="flex flex-wrap items-center gap-4"> <Spinner /> <Spinner className="size-6" /> <Button disabled variant="secondary"> <Spinner /> Deploying vault </Button> <Badge variant="brand"> <Spinner /> Rebalancing </Badge></div><script setup lang="ts">import { Badge } from "@/components/ui/badge";import { Button } from "@/components/ui/button";import { Spinner } from "@/components/ui/spinner";</script>
<template> <div class="flex flex-wrap items-center gap-4"> <Spinner /> <Spinner class="size-6" /> <Button disabled variant="secondary"> <Spinner /> Deploying vault </Button> <Badge variant="brand"> <Spinner /> Rebalancing </Badge> </div></template><script lang="ts"> import { Badge } from "$lib/components/ui/badge"; import { Button } from "$lib/components/ui/button"; import { Spinner } from "$lib/components/ui/spinner";</script>
<div class="flex flex-wrap items-center gap-4"> <Spinner /> <Spinner class="size-6" /> <Button disabled variant="secondary"> <Spinner /> Deploying vault </Button> <Badge variant="brand"> <Spinner /> Rebalancing </Badge></div>Component source
Section titled “Component source”import { cn } from "cn";import type * as React from "react";import { SpinnerIcon } from "@phosphor-icons/react";
function Spinner({ className, ...props }: React.ComponentProps<"svg">) { return ( <SpinnerIcon data-slot="spinner" role="status" aria-label="Loading" className={cn("size-4 animate-spin", className)} {...props} /> );}
export { Spinner };<script setup lang="ts">import type { HTMLAttributes } from 'vue'import { Loader2Icon } from '@lucide/vue'import { cn } from '@/registry/edmi/lib/utils'
const props = defineProps<{ class?: HTMLAttributes['class']}>()</script>
<template> <Loader2Icon data-slot="spinner" role="status" aria-label="Loading" :class="cn('size-4 animate-spin', props.class)" /></template>export { default as Spinner } from "./Spinner.vue";<script lang="ts"> import SpinnerIcon from "phosphor-svelte/lib/Spinner"; import { cn } from "$lib/utils.js"; import type { SVGAttributes } from "svelte/elements";
let { class: className, role = "status", // we add name, color, and stroke for compatibility with different icon libraries props. // only forward them when set, otherwise `stroke: undefined` overrides the icon's `currentColor` name, color, stroke, className: legacyClassName, "aria-label": ariaLabel = "Loading", ...restProps }: SVGAttributes<SVGSVGElement> = $props();</script>
<SpinnerIcon data-slot="spinner" {role} {...name != null ? { name } : {}} {...color != null ? { color } : {}} {...stroke != null ? { stroke } : {}} {...legacyClassName != null ? { className: legacyClassName } : {}} aria-label={ariaLabel} class={cn("size-4 animate-spin", className)} {...restProps}/>export { default as Spinner } from "./spinner.svelte";| Prop | Type | Default |
|---|---|---|
className |
string |
size-4 (use size-* to resize) |
Renders a lucide Loader2Icon with role="status" and aria-label="Loading".
✦ Edmi additions
Section titled “✦ Edmi additions”- None; same anatomy as shadcn. Place inside
Button/Badgeand the icon sizing is picked up.