Element components provide utility UI elements for loading states, progress indicators, and visual enhancements.
The SDK is still in it's early stages. A lot of breaking changes will potentially be introduced as development progresses
Loading spinner component with customizable size and color variants.
<alviere-spinner ></alviere-spinner >
<alviere-spinner size ="lg" variant ="circular" color ="#227e9e" ></alviere-spinner >
<alviere-spinner size ="md" variant ="dots" message ="Loading data..." ></alviere-spinner >
<alviere-spinner size ="sm" primaryColor ="#b3311f" ariaLabel ="Processing" ></alviere-spinner >
html
<script>
import { Spinner } from '@alviere/ui-svelte';
</script>
<!-- Basic usage -->
<Spinner />
<!-- Customized -->
<Spinner size="lg" variant="circular" color="#227e9e" />
<!-- Dots variant with message -->
<Spinner size="md" variant="dots" message="Loading data..." />
<!-- Conditional rendering -->
{#if isLoading}
<Spinner size="md" variant="circular" primaryColor="#436b1d" ariaLabel="Loading content" />
{/if}
svelte
Prop
Type
Default
Description
size
'sm' | 'md' | 'lg'
'md'
Size of the spinner
variant
'circular' | 'dots'
'circular'
Visual variant of the spinner
color
string
''
Custom color for the spinner (overrides theme)
primaryColor
string
''
Primary color for the spinner (alternative to color)
message
string
''
Optional message text displayed below the spinner
ariaLabel
string
'Loading...'
ARIA label for accessibility
Size
CSS Class
Description
sm
.alviere-spinner--sm
Small spinner (16px)
md
.alviere-spinner--md
Medium spinner (24px)
lg
.alviere-spinner--lg
Large spinner (32px)
Color
CSS Class
Description
primary
.alviere-spinner--primary
Primary brand color
secondary
.alviere-spinner--secondary
Secondary brand color
success
.alviere-spinner--success
Success state color
error
.alviere-spinner--error
Error state color
Smooth Animation : CSS-based smooth rotation animation
Accessibility : Proper ARIA attributes for screen readers
Responsive : Scales appropriately on different screen sizes
Customizable : Easy to customize with CSS custom properties
.alviere-spinner {
--spinner-color : var (--primary-color, #007bff );
--spinner-size : 24px ;
--spinner-border-width : 2px ;
--spinner-animation-duration : 1s ;
}
css
.alviere-spinner--custom {
--spinner-color : #ff6b6b ;
--spinner-border-width : 3px ;
}
.alviere-spinner--fast {
--spinner-animation-duration : 0.5s ;
}
css
Timeline component for displaying progress, history, or sequential information.
<script>
import { Timeline } from '@alviere/ui-svelte';
const steps = [
{
label: 'Account Created',
status: 'completed',
description: 'Your account has been successfully created'
},
{
label: 'Verification',
status: 'active',
description: 'Please verify your email address'
},
{
label: 'Setup Complete',
status: 'pending',
description: 'Complete your profile setup'
}
];
</script>
<Timeline
{steps}
size="md"
orientation="vertical"
showLabels={true}
showDescriptions={true}
showConnectors={true}
on:stepclick={(event) => console.log('Step clicked:', event.detail)}
/>
svelte
Prop
Type
Default
Description
steps
TimelineStep[]
[]
Array of timeline steps
size
'sm' | 'md' | 'lg'
'md'
Size of timeline step indicators
orientation
'horizontal' | 'vertical'
'horizontal'
Timeline orientation
showLabels
boolean
true
Show step labels
showDescriptions
boolean
false
Show step descriptions
showConnectors
boolean
true
Show connecting lines between steps
clickable
boolean
false
Make steps clickable
interface TimelineStep {
label : string ;
status : 'completed' | 'active' | 'pending' | 'error' ;
description ?: string ;
icon ?: string ;
timestamp ?: string ;
metadata ?: Record <string , any >;
}
typescript
Status
CSS Class
Description
completed
.alviere-timeline__step--completed
Step has been completed successfully
active
.alviere-timeline__step--active
Step is currently active/in progress
pending
.alviere-timeline__step--pending
Step is waiting to be started
error
.alviere-timeline__step--error
Step encountered an error
Event
Payload
Description
stepclick
{ stepIndex: number, step: TimelineStep }
Fired when a step is clicked (if clickable)
Horizontal : Steps displayed in a row (default)
Vertical : Steps displayed in a column
Step Indicators : Clear visual representation of each step
Connectors : Lines connecting steps to show progression
Status Icons : Visual indicators for step status
Labels & Descriptions : Clear text for each step
Mobile Optimization : Automatically adjusts for small screens
Touch Support : Optimized for touch interactions
Flexible Layout : Adapts to available space
{
"steps" : [
{
"label" : "Started" ,
"status" : "completed"
} ,
{
"label" : "In Progress" ,
"status" : "active"
} ,
{
"label" : "Complete" ,
"status" : "pending"
}
]
}
json
{
"steps" : [
{
"label" : "Account Created" ,
"status" : "completed" ,
"description" : "Your account has been successfully created" ,
"timestamp" : "2024-01-15 10:30 AM"
} ,
{
"label" : "Email Verification" ,
"status" : "active" ,
"description" : "Please check your email and click the verification link" ,
"icon" : "📧"
} ,
{
"label" : "Profile Setup" ,
"status" : "pending" ,
"description" : "Complete your profile information"
} ,
{
"label" : "Ready to Use" ,
"status" : "pending" ,
"description" : "Your account will be fully activated"
}
]
}
json
{
"steps" : [
{
"label" : "Step 1" ,
"status" : "completed" ,
"description" : "Completed successfully"
} ,
{
"label" : "Step 2" ,
"status" : "error" ,
"description" : "Failed to complete - please retry"
} ,
{
"label" : "Step 3" ,
"status" : "pending" ,
"description" : "Waiting for Step 2 to complete"
}
]
}
json
.alviere-timeline {
--timeline-primary-color : var (--primary-color, #007bff );
--timeline-success-color : var (--success-color, #28a745 );
--timeline-error-color : var (--error-color, #dc3545 );
--timeline-warning-color : var (--warning-color, #ffc107 );
--timeline-pending-color : var (--gray-400 , #ced4da );
--timeline-step-size : 2rem ;
--timeline-connector-width : 2px ;
--timeline-step-spacing : 1.5rem ;
--timeline-border-radius : 50% ;
}
css
.alviere-timeline--custom {
--timeline-primary-color : #6f42c1 ;
--timeline-step-size : 3rem ;
--timeline-connector-width : 3px ;
}
.alviere-timeline--horizontal {
--timeline-step-spacing : 2rem ;
}
.alviere-timeline--vertical {
--timeline-step-spacing : 1rem ;
}
css
.alviere-timeline__step--completed {
background-color : var (--timeline-success-color);
border-color : var (--timeline-success-color);
}
.alviere-timeline__step--active {
background-color : var (--timeline-primary-color);
border-color : var (--timeline-primary-color);
box-shadow : 0 0 0 4px rgba (0 , 123 , 255 , 0.25 );
}
.alviere-timeline__step--error {
background-color : var (--timeline-error-color);
border-color : var (--timeline-error-color);
}
.alviere-timeline__step--pending {
background-color : var (--timeline-pending-color);
border-color : var (--timeline-pending-color);
}
css
const timeline = document .querySelector ('alviere-timeline' );
function updateTimeline (stepIndex, newStatus ) {
const currentSteps = JSON .parse (timeline.getAttribute ('data-steps' ));
currentSteps[stepIndex].status = newStatus;
timeline.setAttribute ('data-steps' , JSON .stringify (currentSteps));
}
updateTimeline (1 , 'completed' );
javascript
timeline.setAttribute ('data-clickable' , 'true' );
timeline.addEventListener ('stepclick' , (event ) => {
const { stepIndex, step } = event.detail ;
if (step.status === 'pending' ) {
showStepDetails (step);
}
});
javascript
const customSteps = [
{
label : 'Account Setup' ,
status : 'completed' ,
icon : '👤' ,
description : 'Basic account information'
},
{
label : 'Verification' ,
status : 'active' ,
icon : '✅' ,
description : 'Identity verification process'
},
{
label : 'Activation' ,
status : 'pending' ,
icon : '🚀' ,
description : 'Account activation'
}
];
timeline.setAttribute ('data-steps' , JSON .stringify (customSteps));
javascript
Clear Labels : Use descriptive, concise labels for each step
Logical Order : Arrange steps in a logical, sequential order
Consistent Status : Use consistent status values across the timeline
Visual Hierarchy : Ensure the current step is clearly highlighted
Screen Reader Support : Provide meaningful descriptions for each step
Keyboard Navigation : Ensure timeline is navigable via keyboard
Color Contrast : Maintain sufficient contrast for status indicators
Focus Management : Clear focus indicators for interactive elements
Efficient Updates : Update only changed steps when possible
Smooth Animations : Use CSS transitions for smooth status changes
Responsive Design : Ensure timeline works well on all screen sizes
Memory Management : Clean up event listeners when component is destroyed