Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
React Native docs
FormsReact Native

Secret value

Show a masked value, such as an API key, with show, hide, and copy actions.

Public APILumenSecretValueReact Native

Native example

Use Secret value

Load secrets on demand with loadValue and hide them after a delay. The mask never shows the value length.

Secret value rendered in the Expo web renderer Lumen playground

Captured exampleExpo web renderer

Open interactive preview
Open the Secret value demo
tsx
import * as Clipboard from 'expo-clipboard'
import { LumenSecretValue } from '@santi020k/lumen-react-native'

export const ApiKeyField = ({ fetchKey }: { fetchKey: () => Promise<string> }) => (
  <LumenSecretValue
    autoHideAfter={30_000}
    label="Sandbox API key"
    loadValue={fetchKey}
    onCopy={Clipboard.setStringAsync}
  />
)
React Native
Masks a value such as an API key behind show, hide, and copy actions, loading it on demand and hiding it again.

Reference

Public API

The primary shared and platform-specific options exposed by LumenSecretValue.

APIValues or typeDefaultDescription
label / value or loadValue / autoHideAfterfield name / secret or loader / auto-hide delayrequired / required / neverLoad secrets on demand with loadValue and hide them after a delay.

Native behavior

Design and accessibility

When to use it

Load secrets on demand with loadValue and hide them after a delay. The mask never shows the value length.

Accessibility

The toggle exposes expanded state, and loading, hiding, and copy results are announced.

Shared component

Available on other platforms

Apple / SwiftUIAndroid / Compose Web
React Native docsNative primitives