SenUI Logo

A loading state that tells you something is happening.

SenSpinner is a single accessible SVG. Size in pixels, color through currentColor, screen-reader text built in. Use it inside a button, a panel, or anywhere a moment of patience is needed.

Loading…
Loading…
Loading…

A small motion is enough to mean the system is alive.

Sizes

Any pixel value works — keep it close to the surrounding type for inline use.

Loading…
16px
Loading…
24px
Loading…
32px
Loading…
48px
Loading…
72px

Color

Color comes from currentColor — apply Tailwind text-* utilities and the SVG follows.

Loading…
blue
Loading…
lime
Loading…
rose
Loading…
white

Inside a button

Layout is preserved with absolute positioning so the button stays the same width while it loads.

With a label

Pair with text when the wait is more than a moment, so the user knows what is happening.

Loading…
Fetching the latest data…

currentColor + className

Set the spinner color through Tailwind text-* utilities. The SVG inherits via currentColor.

Accessible by default

role="status" and a sr-only label make screen readers announce loading without visual noise.

Composable

Drop into a button, an empty state, or beside a label — it is just an SVG.

Quick usage

An inline loading row — colored spinner plus a label.

import { SenSpinner } from 'sen-ui'

export function Loading() {
  return (
    <div className="flex items-center gap-3">
      <SenSpinner size={20} className="text-blue-500" />
      <span>Fetching results…</span>
    </div>
  )
}

Full standalone implementation

'use client'

import type { ComponentPropsWithoutRef } from 'react'

export interface SenSpinnerProps {
  size?: number
  srText?: string
}

export default function SenSpinner({
  size = 24,
  srText = 'Loading…',
  className,
  ...props
}: SenSpinnerProps & ComponentPropsWithoutRef<'svg'>) {
  return (
    <div role="status">
      <svg
        className={['animate-spin text-gray-500', className]
          .filter(Boolean)
          .join(' ')}
        style={{ width: size, height: size }}
        viewBox="0 0 24 24"
        fill="none"
        aria-hidden="true"
        {...props}
      >
        <circle
          className="opacity-25"
          cx="12"
          cy="12"
          r="10"
          stroke="currentColor"
          strokeWidth="4"
        />
        <path
          className="opacity-75"
          fill="currentColor"
          d="M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"
        />
      </svg>
      <span className="sr-only">{srText}</span>
    </div>
  )
}