Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Secret
  3. API and Development

Secret

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Secret renders a read-only Input showing a masked value. Default masking repeats bullets for all characters or keeps the last four visible when maskAllCharacters is false. Optional revealable toggles visibility via lead icon; the tail icon copies to clipboard and surfaces snackbar success or error feedback.
Props
NameTypeDefaultDescription
copiedLabelLocalizedMessage—Name of the copy button while the value is copied. Announced to assistive technology when it appears.
copyErrorLabelLocalizedMessage—Name of the copy button when the clipboard refused the value. Announced to assistive technology when it appears.
copyLabelLocalizedMessage—Accessible name of the copy button.
labelLocalizedMessage—Visible label that names the field.
valuestring—The stored secret to mask. Data, not copy, so it is a plain string. While it is masked the string is not in the document; only {@link SecretBaseProps.copyLabel}'s button and a reveal put it anywhere a person can reach.
classNamestring—Classes on the root. Put overrides in @layer chroma.overrides.
defaultRevealedbooleanfalseNot defined without revealable. Whether the value starts shown when uncontrolled.
hideLabelLocalizedMessage—Not defined without revealable. Accessible name of the toggle while the value is shown.
idstring—HTML id of the underlying read-only input. A generated id is used when omitted.
maskAllCharactersbooleantrueWhen true, every character is masked. When false, the last four characters stay visible and the rest are masked; a value of four characters or fewer is always fully masked.
onCopy((value: string) => void)—Called after the value is on the clipboard. @param value - The value that was copied
onCopyError((error: unknown) => void)—Called when neither the Clipboard API nor the fallback could copy the value. @param error - What the clipboard rejected with, or an error describing the failed fallback
onRevealedChange((revealed: boolean, details: ChangeDetails<ChangeReason>) => void)—Not defined without revealable. Called when a person presses the reveal toggle. Cancel the change to keep the previous state. @param revealed - Next state @param details - Change metadata
revealablebooleanfalseWhether the value can be revealed. Without it the field shows the mask only and offers copy. Adds a reveal toggle at the inline end of the field, before the copy button.
revealedboolean—Not defined without revealable. Whether the value is shown (controlled).
revealLabelLocalizedMessage—Not defined without revealable. Accessible name of the toggle while the value is masked. It names the action, so it differs from {@link SecretRevealableProps.hideLabel}.
sizeInputSizeInputSize.LargeControl scale of the field and its buttons, from the shared control heights.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Examples
The docs app mounts a single Toaster in the shell so copy feedback works without nesting another manager.
Default
Revealable
Last four visible
Non-revealable
All states
Previous
Secret / Usage
Next
Secret / Accessibility
On this page
Props
Storybook
Examples
Default
Revealable
Last four visible
Non-revealable
All states