Files
supabase/apps/design-system/registry/default/example/data-input-with-copy-secret.tsx
Danny White 73f8a15203 chore(studio): consistent copy/reveal input behaviour (#39509)
* user newer input in api keys

* user newer input in s3 connection settings

* improve input read-only styles

* make API text selectable

* disable text until reveal button tapped

* fix build

* revert change

* fix other cases

* revert hardcoded example

* nice region field

* documentation

* cleanup

* better docs

* colour tweaks
2025-10-16 13:44:40 +11:00

19 lines
423 B
TypeScript

import { Input } from 'ui-patterns/DataInputs/Input'
export default function DataInputWithCopySecret() {
const actualValue = 'sb_secret_1234567890'
const maskedValue = 'sb_secret_123•••••••'
return (
<Input
containerClassName="w-full max-w-sm"
readOnly
copy
value={maskedValue}
onCopy={() => {
navigator.clipboard.writeText(actualValue)
}}
/>
)
}