@polarityio/pi-spinner
v1.0.5
Published
Loading spinner with configurable size and optional label
Readme
Polarity Integration Component Library
Spinner Component
A loading spinner with configurable size and optional label.
Installation
npm install @polarityio/pi-spinnerPeer Dependencies
- lit ^3.0.0
Usage
import '@polarityio/pi-spinner';<!-- Basic spinner -->
<pi-spinner></pi-spinner>
<!-- Spinner with label and size -->
<pi-spinner size="md" label="Loading results..." label-position="after"></pi-spinner>
<!-- Large spinner with label before -->
<pi-spinner size="lg" label="Please wait" label-position="before"></pi-spinner>API Reference
Properties
| Property | Type | Default | Description |
| --------------- | -------------------------------------- | --------- | ----------------------------------------------------------------------------- |
| label | string | '' | Loading text displayed alongside the spinner |
| labelPosition | 'before' \| 'after' | 'after' | Position of the label relative to the spinner |
| size | 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' | 'xs' | Size of the spinner (xs=0.75rem, sm=0.875rem, md=1rem, lg=1.25rem, xl=1.5rem) |
CSS Custom Properties
| Property | Default | Description |
| ------------------------- | -------------- | ------------------------ |
| --pi-spinner-icon-color | currentColor | Color of the spinner arc |
Theming
Customize the appearance using CSS custom properties. This component uses design tokens from @polarityio/pi-shared for consistent theming across the component library.
License
MIT
