data-display/DSStatusLabel

DSStatusLabel

data-display
since 0.1.0

Status label with icon indicating success, warning, error, info, or neutral state.

iOS 17+macOS 14+watchOS 10+tvOS 17+visionOS 1+

Purpose

Use to display status information with appropriate color and icon. Provides instant visual feedback.

Interactive Reference

Live showroom

Need the full visual surface?

Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().

Best for exploring:

variants, states, categories, and real app examples in one place.

Variants

status-label-success screenshot

.success

Green with checkmark icon

status-label-warning screenshot

.warning

Yellow with warning icon

status-label-error screenshot

.error

Red with error icon

status-label-info screenshot

.info

Blue with info icon

status-label-neutral screenshot

.neutral

Gray with circle icon

Props

PropTypeDefaultDescription
textreqString—Status text (first, unlabeled argument).
styleDSStatusLabelStyle.neutral.success, .warning, .error, .info or .neutral.
showIconBooltrueShows the leading status icon.
accessibilityLabelString?nilVoiceOver override.

Examples

Order status

Map your model to a style.

swift
switch order.status {
case .delivered:
    DSStatusLabel("Delivered", style: .success)
case .pending:
    DSStatusLabel("Pending", style: .warning)
case .cancelled:
    DSStatusLabel("Cancelled", style: .error)
}

System health

Display system or service status.

swift
HStack(spacing: DSSpacing.sm) {
    DSText("API Status:", style: .callout)
    DSStatusLabel("Operational", style: .success)
}

Usage Guidelines

  • Use semantic colors that match the status meaning
  • Keep text short and clear (1-2 words)
  • Icons provide quick visual scanning

When to Use

✓ Use DSStatusLabel for:

  • • Status indicators with semantic meaning (success, warning, error)
  • • System health or service status displays
  • • Order, task, or process status in lists
  • • Real-time status updates with icons

✗ Avoid using for:

  • • Non-status labels (use DSBadge)
  • • Interactive filters (use DSChip)
  • • Simple text without semantic meaning (use Text)
  • • Count indicators (use DSBadge)

Consider instead:

DSBadge

For non-status labels without semantic icons

DSChip

For interactive, selectable filters

DSNoticeBar

For full-width status banners

Accessibility

VoiceOver

Announces '[text], Status, [style]' (e.g., 'Delivered, Status, Success')

Keyboard

  • • Not interactive - display only

Dynamic Type

✓ Supported

Contrast

WCAG AA compliant (icon and text 4.5:1)

Traits

.isStaticTextIcon meaning conveyed via style nameColor not sole indicator

Related Components