Checking stockLoading orders
import { Spinner } from '@brand-studio/ui';
export default function SpinnerDemo() {
return (
<div style={{ display: 'flex', flexWrap: 'wrap', alignItems: 'center', gap: 32 }}>
<Spinner label="Checking stock" />
<Spinner size={32} label="Loading orders" hideLabel />
</div>
);
}Installation
pnpm add @brand-studio/uinpm install @brand-studio/uiyarn add @brand-studio/uibun add @brand-studio/uiInstall the peer dependencies
npm install react react-domImport the stylesheet once
import '@brand-studio/ui/styles.css';Wrap your app in a brand theme
import { BrandTheme, Spinner } from '@brand-studio/ui'; import brand from './brand.json'; <BrandTheme palette={brand.tokens} mode="system"> {/* your app */} </BrandTheme>
Usage
import { Spinner } from '@brand-studio/ui';<Spinner label="Checking stock" />Accessibility
- The label sits in a
role="status"region.hideLabelkeeps it for screen readers only. - Under reduced motion the ring stops turning and the label carries the meaning.
- Use Skeleton when you know the shape of what is loading, and Button's
loadingprop for a pressed button.
API Reference
| Prop | Type | Default |
|---|---|---|
label? | string | 'Loading' |
hideLabel? | boolean | false |
size? | number | 20 |
className? | string | '' |