What it does
The secret reveal component displays a value that is masked by default with dot characters. A toggle button switches between hidden and revealed states. The static variant uses React state for the toggle, while the animated variant offers framer-motion powered transitions including fade, slide-up, scale, and flip.
Combine with a label displayed above the value for context like "API Key" or "Password".
Composition and API
Pass the secret value via the value prop and optionally a label. Choose from the full appearance palette and size scale. The component ships two variants: the default static entry uses simple React state toggling with zero JavaScript runtime cost, while the animated entry (imported from the /animated subpath) provides framer-motion enhanced reveal transitions.
Common use cases
The secret reveal component is ideal for displaying sensitive credentials in developer dashboards, password managers, API configuration panels, and payment gateway settings where visual masking is required by default.
Accessibility
The toggle button uses a dynamic aria-label attribute to communicate the current action to assistive technologies. Keyboard order, focus rings, and ARIA attributes should match production usage.
This preview page exposes a single h1 in the hero for a clean outline.
Next.js integration notes
Colocate examples under the App Router, keep server and client boundaries explicit, and avoid pulling interactive overlays into unexpected server layouts.
Set NEXT_PUBLIC_SITE_URL so canonical and Open Graph URLs resolve on deploy.
FAQ
Does the Secret Reveal component work with Next.js App Router?
Yes. Import it like any other React component; the component uses client-side state for the reveal toggle and works seamlessly with server components when used as a client boundary.
Can I customize the secret reveal with Tailwind CSS?
Zentauri UI exposes class-friendly variants and slots so you can extend styles with Tailwind utilities without fighting inline styles.
Is the secret content secure when masked?
The masking is a client-side visual treatment — it does not encrypt the value. Use the component for UI convenience in trusted environments, not as a security boundary.