Status Indicator
<zn-status-indicator>
ZnStatusIndicator
Circular status indicators.
<zn-status-indicator type="info"></zn-status-indicator> <zn-status-indicator type="success"></zn-status-indicator> <zn-status-indicator type="warning"></zn-status-indicator> <zn-status-indicator type="error"></zn-status-indicator>
Examples
Basic Status Indicator
A basic status indicator displays as a small circular dot with the default info color.
<zn-status-indicator></zn-status-indicator>
Types
Use the type attribute to set the semantic meaning and color of the status indicator. Available
types are: info (default), success, warning, error, and
disabled.
<zn-status-indicator type="info"></zn-status-indicator> <zn-status-indicator type="success"></zn-status-indicator> <zn-status-indicator type="warning"></zn-status-indicator> <zn-status-indicator type="error"></zn-status-indicator> <zn-status-indicator type="disabled"></zn-status-indicator>
Glow
Add the glow attribute to animate a throbbing glow effect around the indicator, useful for
drawing attention to a live or active status.
<zn-status-indicator type="info" glow></zn-status-indicator> <zn-status-indicator type="success" glow></zn-status-indicator> <zn-status-indicator type="warning" glow></zn-status-indicator> <zn-status-indicator type="error" glow></zn-status-indicator>
Alternating Status
Use the alt-type attribute to animate the indicator between two statuses. This is useful for
representing a status that is transitioning or flapping between two states, e.g. a service moving between
warning and offline (disabled).
<zn-status-indicator type="warning" alt-type="disabled"></zn-status-indicator> <zn-status-indicator type="success" alt-type="warning"></zn-status-indicator> <zn-status-indicator type="error" alt-type="info"></zn-status-indicator>
The alt-type attribute accepts the same values as type: info,
success, warning, error, and disabled. Combine it with
glow for a pulsing, colour-switching effect.
<zn-status-indicator type="warning" alt-type="disabled" glow></zn-status-indicator>
With Labels
Status indicators are commonly used alongside text labels to provide context.
<div style="display: flex; gap: 8px; align-items: center;"> <zn-status-indicator type="success"></zn-status-indicator> <span>Online</span> </div> <br /> <div style="display: flex; gap: 8px; align-items: center;"> <zn-status-indicator type="warning"></zn-status-indicator> <span>Away</span> </div> <br /> <div style="display: flex; gap: 8px; align-items: center;"> <zn-status-indicator type="error"></zn-status-indicator> <span>Offline</span> </div> <br /> <div style="display: flex; gap: 8px; align-items: center;"> <zn-status-indicator type="info"></zn-status-indicator> <span>Idle</span> </div>
Service Status
Status indicators are useful for displaying the health of services or systems.
<div style="display: flex; flex-direction: column; gap: 12px;"> <div style="display: flex; justify-content: space-between; align-items: center; padding: 8px; border: 1px solid var(--zn-color-border); border-radius: 4px;"> <span>API Service</span> <div style="display: flex; gap: 8px; align-items: center;"> <zn-status-indicator type="success"></zn-status-indicator> <span>Operational</span> </div> </div> <div style="display: flex; justify-content: space-between; align-items: center; padding: 8px; border: 1px solid var(--zn-color-border); border-radius: 4px;"> <span>Database</span> <div style="display: flex; gap: 8px; align-items: center;"> <zn-status-indicator type="warning"></zn-status-indicator> <span>Degraded</span> </div> </div> <div style="display: flex; justify-content: space-between; align-items: center; padding: 8px; border: 1px solid var(--zn-color-border); border-radius: 4px;"> <span>Cache Server</span> <div style="display: flex; gap: 8px; align-items: center;"> <zn-status-indicator type="error"></zn-status-indicator> <span>Down</span> </div> </div> <div style="display: flex; justify-content: space-between; align-items: center; padding: 8px; border: 1px solid var(--zn-color-border); border-radius: 4px;"> <span>CDN</span> <div style="display: flex; gap: 8px; align-items: center;"> <zn-status-indicator type="success"></zn-status-indicator> <span>Operational</span> </div> </div> </div>
User Presence
Display user availability status with status indicators.
<div style="display: flex; flex-direction: column; gap: 12px;"> <div style="display: flex; gap: 12px; align-items: center;"> <div style="position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--zn-color-neutral-200); display: flex; align-items: center; justify-content: center;"> <zn-icon src="person" size="24"></zn-icon> <div style="position: absolute; bottom: 0; right: 0;"> <zn-status-indicator type="success"></zn-status-indicator> </div> </div> <span>John Doe - Available</span> </div> <div style="display: flex; gap: 12px; align-items: center;"> <div style="position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--zn-color-neutral-200); display: flex; align-items: center; justify-content: center;"> <zn-icon src="person" size="24"></zn-icon> <div style="position: absolute; bottom: 0; right: 0;"> <zn-status-indicator type="warning"></zn-status-indicator> </div> </div> <span>Jane Smith - Away</span> </div> <div style="display: flex; gap: 12px; align-items: center;"> <div style="position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--zn-color-neutral-200); display: flex; align-items: center; justify-content: center;"> <zn-icon src="person" size="24"></zn-icon> <div style="position: absolute; bottom: 0; right: 0;"> <zn-status-indicator type="error"></zn-status-indicator> </div> </div> <span>Bob Johnson - Offline</span> </div> </div>
List Items
Status indicators work well in lists to show item states.
<div style="display: flex; flex-direction: column; gap: 4px;"> <div style="display: flex; gap: 8px; align-items: center; padding: 8px;"> <zn-status-indicator type="success"></zn-status-indicator> <span>Payment processed successfully</span> </div> <div style="display: flex; gap: 8px; align-items: center; padding: 8px;"> <zn-status-indicator type="warning"></zn-status-indicator> <span>Order pending confirmation</span> </div> <div style="display: flex; gap: 8px; align-items: center; padding: 8px;"> <zn-status-indicator type="error"></zn-status-indicator> <span>Failed to verify email address</span> </div> <div style="display: flex; gap: 8px; align-items: center; padding: 8px;"> <zn-status-indicator type="info"></zn-status-indicator> <span>New notification received</span> </div> </div>
Custom Colors
Use the --indicator-color CSS variable to customize the indicator color for specific use cases.
<zn-status-indicator style="--indicator-color: 128, 90, 213;"></zn-status-indicator> <zn-status-indicator style="--indicator-color: 236, 72, 153;"></zn-status-indicator> <zn-status-indicator style="--indicator-color: 16, 185, 129;"></zn-status-indicator> <zn-status-indicator style="--indicator-color: 245, 158, 11;"></zn-status-indicator>
Note: The --indicator-color variable expects RGB values without the rgb() wrapper,
as it uses rgba() internally for opacity control.
Legend
Status indicators can be used in legends to explain color-coded information.
<div style="display: flex; gap: 16px; flex-wrap: wrap;"> <div style="display: flex; gap: 6px; align-items: center;"> <zn-status-indicator type="success"></zn-status-indicator> <span style="font-size: 14px;">Completed</span> </div> <div style="display: flex; gap: 6px; align-items: center;"> <zn-status-indicator type="warning"></zn-status-indicator> <span style="font-size: 14px;">In Progress</span> </div> <div style="display: flex; gap: 6px; align-items: center;"> <zn-status-indicator type="error"></zn-status-indicator> <span style="font-size: 14px;">Failed</span> </div> <div style="display: flex; gap: 6px; align-items: center;"> <zn-status-indicator type="info"></zn-status-indicator> <span style="font-size: 14px;">Pending</span> </div> </div>
Table Integration
Status indicators are commonly used in tables to show row or cell status.
| Status | Task | Assignee |
|---|---|---|
|
|
Deploy to production | John Doe |
|
|
Code review pending | Jane Smith |
|
|
Tests failing | Bob Johnson |
|
|
Update documentation | Alice Williams |
<table style="width: 100%; border-collapse: collapse;"> <thead> <tr style="border-bottom: 1px solid var(--zn-color-border);"> <th style="text-align: left; padding: 12px;">Status</th> <th style="text-align: left; padding: 12px;">Task</th> <th style="text-align: left; padding: 12px;">Assignee</th> </tr> </thead> <tbody> <tr style="border-bottom: 1px solid var(--zn-color-border);"> <td style="padding: 12px;"> <zn-status-indicator type="success"></zn-status-indicator> </td> <td style="padding: 12px;">Deploy to production</td> <td style="padding: 12px;">John Doe</td> </tr> <tr style="border-bottom: 1px solid var(--zn-color-border);"> <td style="padding: 12px;"> <zn-status-indicator type="warning"></zn-status-indicator> </td> <td style="padding: 12px;">Code review pending</td> <td style="padding: 12px;">Jane Smith</td> </tr> <tr style="border-bottom: 1px solid var(--zn-color-border);"> <td style="padding: 12px;"> <zn-status-indicator type="error"></zn-status-indicator> </td> <td style="padding: 12px;">Tests failing</td> <td style="padding: 12px;">Bob Johnson</td> </tr> <tr> <td style="padding: 12px;"> <zn-status-indicator type="info"></zn-status-indicator> </td> <td style="padding: 12px;">Update documentation</td> <td style="padding: 12px;">Alice Williams</td> </tr> </tbody> </table>
Properties
| Name | Description | Reflects | Type | Default |
|---|---|---|---|---|
altType
alt-type
|
A secondary status type. When set, the indicator animates between type and this colour
to represent a status transitioning between two states (e.g. warning and
disabled).
|
'success' | 'error' | 'warning' | 'info' | 'disabled' | undefined
|
- | |
glow
|
Animates a throbbing glow effect around the indicator. |
|
boolean
|
false
|
updateComplete |
A read-only promise that resolves when the component has finished updating. |