Skip to content
Cynosurev0.5.0
SearchStorybookGitHubnpmColour mode: System. Switch to Light

Components / Feedback and display

LoadingDots

Three dots that pulse in sequence, or a turning spinner, for short waits of unknown length. For a task with known progress, show the progress itself.

Default

When to useLink to "When to use"

  • Inside a button while it saves (Button does this for you with loading).
  • Inline status text, list footers, a panel that is still loading.

UsageLink to "Usage"

tsx
Copy
import { LoadingDots } from "@arshad-shah/cynosure";

<LoadingDots label="Saving document" />        // announced
<LoadingDots size="lg" tone="accent" />        // decorative
<LoadingDots color="#14b8a6" speed="slow" />   // one-off colour

Announcing itLink to "Announcing it"

By default the dots are decorative. Set label to give them role="status" and an accessible name. Leave it out when the surrounding control already reports the state, as Button does with aria-busy.

Labelled

Size, tone and speedLink to "Size, tone and speed"

size defaults to inherit, which follows the surrounding font size; sm, md and lg are fixed. tone is any tone, muted, or inherit (the current text colour). speed is slow, normal or fast. color takes any CSS colour for one-off cases; prefer tones.

SpinnerLink to "Spinner"

variant="spinner" draws the loader icon turning instead of the dots. It is one em square, so it sits where an icon would: a statement gutter, a tree row, a tool call's header, beside a button's text. It takes the same size, tone, color, speed and label.

tsx
Copy
<Button>
  <LoadingDots variant="spinner" /> Connecting
</Button>

PropsLink to "Props"

Every prop of LoadingDots
PropWhat it doesTypeDefault
variant
dots (default): three dots that pulse in sequence. spinner: the loader icon turning, icon-sized, for tight places such as a gutter, a tree row or beside a button's text."dots" | "spinner"
size
inherit follows the surrounding font size (use inside text and buttons); otherwise a fixed size."sm" | "md" | "lg" | "inherit"
tone
Semantic colour. inherit uses the current text colour.Tone | "inherit" | "muted"
color
Any CSS colour; overrides tone for one-off cases. Prefer tones or tokens.string
speed
Pulse or turn speed. Reduced motion always shows still dots or a still spinner."slow" | "normal" | "fast"
label
Announces progress (role="status") with this name. Omit when the surrounding control already reports it (e.g. Button aria-busy).string
className
Added to the root element, for layout.string
style
Layout only. Restyle through --cy-loading-dots-* tokens.CSSProperties
data-testid
Set on the root element, for tests.string

Generated from the type definitions in @arshad-shah/cynosure 0.5.0.

Behaviour and accessibilityLink to "Behaviour and accessibility"

  • Reduced motion: with the OS setting or createTheme({ motion: "reduced" }), the dots stay still and fully visible, and the spinner stops turning.
  • Without a label the dots or spinner are aria-hidden. The spinner's icon is always decorative; with a label the root is the status.

ThemingLink to "Theming"

Tokens: --cy-loading-dots-dot-size, --cy-loading-dots-gap, --cy-loading-dots-color, --cy-loading-dots-duration and --cy-loading-dots-size-{sm,md,lg}.

ts
Copy
createTheme({ components: { loadingDots: { gap: "0.4em" } } });
Custom colour and speed

Button

These examples run Cynosure 0.5.0 (commit 50ce30b), the version on npm.

Getting started
Theming
Icons
Accessibility
Code editors and highlighters
Using Cynosure without React
Build-tool adapters
Components
Accordion
AppShell
AspectRatio
Breadcrumbs
Calendar
Card
Container
Disclosure
Divider
DocumentViewport
Grid
Inline
PageHeader
PanZoomCanvas
ScrollArea
SideNav
SortableList
SplitPane
Stack
StatusBar
Tabs
TitleBar
Toolbar
Tree
VirtualList
ZoomControls
Announcer
Avatar
Badge
CodeBlock
DescriptionList
EmptyState
ErrorBoundary
Field
Heading
IconTile
Image
Kbd
List
LoadingDots
Notice
ProgressBar
Prose
Skeleton
Stat
Steps
Table
Text
Button
Checkbox
Checklist
ColorField
ColorSwatches
Combobox
CompareSlider
CopyButton
DateField
FileDrop
IconButton
KeyValueEditor
Link
NumberField
Pagination
PathField
RadioGroup
SearchField
SegmentedControl
Select
SelectionFrame
SignaturePad
Slider
Switch
TagInput
TextArea
TextField
ThemeToggle
TimeField
ButtonBase
ChoiceBase
DialogBase
FileInputBase
HiddenValue
Icon
InputBase
LinkBase
LiveRegion
TextAreaBase
ChatMessage
Choice
DataGrid
DeviceFrame
HighlightedText
HotkeyField
ListRow
OptionList
OverlayFrame
QRCode
RowActions
Section
SiteFooter
SiteHeader
SkipLink
SortButton
VisuallyHidden
CommandPalette
ContextMenu
Dialog
FloatingToolbar
HoverCard
Menu
Menubar
Popover
ProgressOverlay
Sheet
Toast
Tooltip
Changelog