@eisberg-labs/mui-copy-field
TypeScript icon, indicating that this package has built-in type declarations

4.0.2 • Public • Published

Downloads

Mui Copy Field

Material UI TextField with copy to clipboard functionality.

Example

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

Installation

Since this is an extension of mui components, prerequisite is to have material library already installed.

npm i --save @mui/material @emotion/react @emotion/styled @mui/icons-material

As for the mui-copy-field:

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

Usage

import {DefaultCopyField} from '@eisberg-labs/mui-copy-field';

<DefaultCopyField
  label="Click on copy Button"
  value={"Enter text"} />

or:

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"}
/>

Api

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

All TextField props are also supported.

License

MIT © Eisberg Labs

Package Sidebar

Install

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

Weekly Downloads

205

Version

4.0.2

License

MIT

Unpacked Size

10.6 kB

Total Files

9

Last publish

Collaborators

  • eisberg-labs