ShadSpinner constructor

const ShadSpinner({
  1. Key? key,
  2. double? size,
  3. Color? color,
  4. Color? trackColor,
  5. double? strokeWidth,
  6. Duration? duration,
  7. String? semanticLabel,
})

An indeterminate circular loading indicator.

Mirrors shadcn/ui's Spinner. Unlike ShadProgress, which is a linear bar, this is the small inline spinner you put inside a button or next to a label while an action is in flight.

ShadButton(
  onPressed: submitting ? null : submit,
  leading: submitting ? const ShadSpinner(size: 16) : null,
  child: const Text('Save'),
)

Implementation

const ShadSpinner({
  super.key,
  this.size,
  this.color,
  this.trackColor,
  this.strokeWidth,
  this.duration,
  this.semanticLabel,
});