/mui-copy-field

Material-UI text field with copy to clipboard button

Primary LanguageTypeScriptMIT LicenseMIT

⚠ Project is moved to React Components.

Downloads Build status

Material UI TextField with copy to clipboard functionality.

Example

If you 👍 or use this project, consider giving it a ★, thanks! 🙌

Installation

npm i --save @eisberg-labs/mui-copy-field

Usage

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

Demo

Try the Demo in StackBlitz

License

MIT © Eisberg Labs