Back to Grafana

Secret Input

packages/grafana-ui/src/components/SecretInput/SecretInput.mdx

13.0.2709 B
Original Source

import { ArgTypes } from '@storybook/blocks'; import { SecretInput } from './SecretInput';

Secret Input

Used for secret/password input. It has 2 states: configured and not configured.

  • If configured it will disable the input and add a reset button that will clear the input and make it accessible.
  • In non configured state it behaves like a normal password input.

This is used for passwords or anything that is encrypted on the server and is later returned encrypted to the user (like datasource passwords).

Usage

tsx
import {SecretInput} from '@grafana/ui';

<SecretInput
  value={...}
  isConfigured={...}
  onChange={...}
  onReset={...}
/>
<ArgTypes of={SecretInput} />