sigilUI

State Persistence

Preserve a value across reloads using browser storage.

@sigil-ui/componentsReact

Preview

Persisted state Interactive

Import

import { StatePersistence } from "@sigil-ui/components";

Usage

<StatePersistence
    activeItem={{ label: "Active workspace", sublabel: "restored", value: "Free", valueLabel: "while idle", variant: "success" }}
    competitors={[{ label: "Ephemeral runner", value: "$0.09/hr", variant: "danger" }]}
    persistedState={[{ label: "Installed packages", status: "Ready" }, { label: "Working tree", status: "Saved" }]}
  />

Props

PropTypeDefaultDescription
activeItemPersistenceActiveItem—The primary "active" item (e.g. the product being promoted).
competitorsPersistenceActiveItem[]—Competing items shown for comparison.
persistedStatePersistedStateRow[]—Rows of persisted state.
activeLabelstring—Section labels.
stateLabelstring——

Token integration

CSS VariablePurpose
--s-successSuccess
--s-errorError
--s-borderBorder
--s-text-mutedText muted
--s-duration-normalDuration normal
--s-ease-springEase spring
--s-radius-fullRadius full
--s-duration-slowDuration slow
--s-textText
--s-backgroundBackground
--s-ease-outEase out
--s-duration-fastDuration fast