Skip to main content

Primitive contract

ErrorState

Names a failure, preserves source or reference context, and exposes explicit recovery without blame or false certainty.

Recoverable failure explanation · @sanchika/primitives

Purpose and semantics

Names a failure, preserves source or reference context, and exposes explicit recovery without blame or false certainty.

Recommended semantic: Use a labelled section; dynamic errors may use alert or status when context requires it, without moving focus automatically.

Anatomy

title

Names the failure.

explanation

Explains what is known.

recovery action

Explicit retry or safe next step.

support action

Optional support path.

reference

Optional source or reference ID.

technical detail

Optional native disclosure.

Finite variants and important states

Variant · severity
recoverable, blocking
Required states
recoverable, blocking, with-details
Class hooks
.sk-error-state · .sk-error-state-blocking · .sk-error-state__actions · .sk-error-state__reference · .sk-error-state__details

Composed synthetic exemplar

Rendered state matrix

ErrorState: 3 required states

Each specimen starts from the package-owned example and contract state inventory. Simulated pointer and focus frames are labelled; consumers still verify real interaction in context.

recoverableThe recoverable contract remains visible and inspectable.

Could not copy the reference

Copy it manually or try again.

Reference COPY-EXAMPLE-01

blockingThe blocking contract remains visible and inspectable.

Could not copy the reference

Copy it manually or try again.

Reference COPY-EXAMPLE-01

with detailsThe with details contract remains visible and inspectable.

Could not copy the reference

Copy it manually or try again.

Reference COPY-EXAMPLE-01

Accessibility and consumer responsibility

Keyboard and screen reader
  • Retry and support actions use native controls
  • Dynamic errors do not steal focus
  • Choose alert/status only for actual dynamic context
  • Keep reference and recovery in reading order
Consumer owns
  • Choose announcement semantics
  • Implement retry
  • Sanitize technical detail
  • Preserve focus
Mobile
  • Actions wrap and details remain reachable
Reduced motion and forced colors

No override is required.

  • Boundary, wording, and actions remain visible

Compact API reference

Package
@sanchika/primitives
CSS
@sanchika/primitives/styles.css
Contract
primitiveSpecs.find((contract) => contract.name === "ErrorState")
Primary class
.sk-error-state