Skip to content
Eskais UI

Accounts

Secret List

SecretList: stored secrets, like API keys, as rows with their name, a SecretFingerprint (•••• abcd), a configured or missing StatusPill, created, updated and last-used dates, and Replace and Delete. The data type has no value field. Loading, empty and error come through DataState. With selectable, each row gets a checkbox (disabled with a reason per secret) and an optional tri-state select all. Agents can replace and delete by id (delete waits for a person), and select by name or id.

Example

API keys
Stored encrypted for your account. Values can be replaced, never read back.
  • OpenAI API key
    Configured
    Summaries and searchHidden value ending in x7QaUpdated · Created · Last used
  • Stripe webhook secret
    Configured
    Hidden value ending in 9f2cUpdated · Created · Never used
  • GitHub token
    Missing
    Opens pull requests
Keys on this device
A chooser: selectable, with no Replace or Delete. Pick the keys to upload; only their last characters show.
  • OpenAI API key
    Found
    From ~/.config/toolsHidden value ending in x7Qa
  • GitHub token
    Found
    From the system keychainHidden value ending in 9f2c
  • Stripe live key
    Found
    Hidden value ending in 41dd
    Live payment keys stay on this device.

Installation

npx shadcn@latest add @eskais/secret-list

Usage

Import
import { secretList } from "@/components/ui/secret-list-primitive"import { SecretList, secretListLabels } from "@/components/ui/secret-list"

A settings page of stored secrets: rows with a mask and the server's fingerprint, never a value; Replace opens your FormDialog with a sensitive Input, and Delete asks first. Each action shows only with its callback, so selectable with neither is a chooser, like keys to upload.

API reference

SecretList

PropTypeDefault
aria-labelrequiredNames the list for screen readers and agents, like "API keys".string–
secretsreadonly StoredSecret[]–
statusThe list's load state, for DataState. `success` by default.DataStatus–
errorunknown–
onRetry() => unknown–
selectableGives each secret a checkbox; agents `select(nameOrId, checked)` and `selectAll(checked)`.boolean–
selectedThe selected ids, to control the selection.readonly string[]–
defaultSelectedreadonly string[]–
onSelectedChangeThe new selected ids; `details.cancel()` keeps the old ones, and an agent's step then fails with why.(ids: string[], details: ChangeDetails<SecretListSelectionChangeReason>) => void–
textrequiredSecretListText<never> | SecretListReplaceText | SecretListDeleteText–
labelsPartial<SecretListLabels>–
localeThe locale of the relative dates; the page's by default.string–
classNamestring–
onReplaceAsks to replace or set a secret's value, like opening a dialog with a sensitive Input.undefined | (id: string) => unknown–
onDeleteDeletes a secret after the confirmation; a returned Promise keeps it pending.undefined | (id: string) => unknown–

Other exports

secretListsecretListLabelstype SecretListItemtype SecretListOptionstype SecretListSelectionChangeReasontype SecretListStatetype SecretListUnselectabletype SecretListActiontype SecretListDeleteTexttype SecretListLabelstype SecretListPropstype SecretListReplaceTexttype SecretListTexttype SecretTexttype StoredSecret

Accessibility

  • The mask is hidden from screen readers, which hear the fingerprint instead (Hidden value ending in a1b2, overridable).
  • Each row's Replace and Delete are named for the secret, and Delete opens an alert dialog before anything is removed.
  • The status is a pill with a dot and its word, so it doesn't rest on colour alone.

Agent actions

Agents read the secrets as the list's items and call replace(id) and delete(id); delete opens the confirmation, whose button needs a person. With selectable, they call select(nameOrId, checked) and selectAll(checked) and read the selected names; an unknown name, a disabled secret or a list that isn't selectable fails the step with why. An unknown id fails replace and delete with why, and so does a list without onReplace or onDelete.

Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.