⚠ Project is moved to React Components.
Material UI TextField with copy to clipboard functionality.
If you 👍 or use this project, consider giving it a ★, thanks! 🙌
npm i --save @eisberg-labs/mui-copy-field
Take a look at Storybook examples for example usage.
You can use it like TextField
:
import {DefaultCopyField} from '@eisberg-labs/mui-copy-field';
<DefaultCopyField
label="Click on copy Button"
value={"Enter text"} />
or like TextField
with extra props:
import {CopyField} from '@eisberg-labs/mui-copy-field';
<CopyField
label="Click on copy Button"
value={"Enter text"}
onCopySuccess={console.log}
onCopyError={console.log}
copyTooltip={"Some copy tooltip. Default is Copy"}
/>
Name | Type | Default | Description |
---|---|---|---|
copyTooltip | string | "Copy" | Copy button tooltip |
onCopySuccess | Function | undefined | If defined, fired on copy to clipboard |
onCopyError | Function | undefined | If defined, fired on copy to clipboard error |
MIT © Eisberg Labs