Components
Loading
A customizable animated loading indicator component
Loading Component
-The Loading component provides a sleek, animated loading indicator featuring three pulsating circles. It's designed to provide visual feedback during asynchronous operations or loading states in your application. +The Loading component provides a sleek, animated loading indicator featuring an 8-segment circular spinner. It's designed to provide visual feedback during asynchronous operations or loading states in your application.
Usage
Examples
Default
Size and Segment duration
Customization
The Loading component is highly customizable:
- Color: Inherits the text color of its parent element through the
fill-current
class - Size: Adjustable through width and height props
- Animation Speed: Configurable animation duration
- Responsive: Adapts seamlessly to different container sizes
Props
Prop | Type | Default | Description |
---|---|---|---|
size | number | 24 | Sets both width and height of the loading indicator |
dur | number | 125 | Animation duration in milliseconds per segment |
className | string | undefined | Additional CSS classes to apply |
The component also accepts all standard HTML attributes supported by the underlying SVG element.
Accessibility
The Loading component is built with accessibility in mind:
- Includes appropriate ARIA attributes
- Provides visual feedback without relying on color alone
- Maintains good contrast ratios
Best Practices
- Use consistent sizes within the same context
- Place the loader in a logical location relative to the content being loaded
- Consider using a minimum display duration to prevent flickering
- Ensure sufficient contrast between the loader and its background