Last modified: 4/Oct/2024
CopyBox
Use the CopyBox component to display short, textual information with a descriptive label that a user is probably going to copy + paste into somewhere. E.g. referral ID, password, etc.
#Usage
import { CopyBox } from '@kinsta/stratus'
const MyComponent = () => (
<CopyBox label="Copy box label" type="text" text="copyable text"/>
)
#Props
#text
string
The text to be copied
#isReadOnly
boolean
Set content to be readonly
#isDense
boolean
@deprecated It's going to be removed in a future version
and will be replaced with size prop
#label
string | ReactElement<any, string | JSXElementConstructor<any>>
The label describing the component
#isDisabled
boolean
#type
"text" | "password"
text will show the text to be copied, while password hides it like a password
string
The aria label given to the copy button
#onCopy
() => void
callback when the copy button is clicked
#Types
CopyBoxProps
: props of theCopyBox
component processed by stratusCopyBoxInterface
:CopyBoxProps
extended byOmit<InputHTMLAttributes<HTMLInputElement>, 'prefix'>
Read more about types here