react-admin-clipboard-list-field
v0.1.4
Published
Copy to clipboard in one click in React Admin
Downloads
79
Readme
React Admin Clipboard List Field
Copy various formats of the same value to clipboard in one click in React Admin.
Setup
npm install --save react-admin-clipboard-list-field
import { ClipboardListField } from 'react-admin-clipboard-list-field';
const createRows = (value) => {
return [
value,
`ObjectId("${value})"`,
];
}
export const UserEdit = (props) => (
<Edit {...props}>
<SimpleForm>
...
<ClipboardListField source="id" iconPosition="left" createRows={createRows} />
...
</SimpleForm>
</Edit>
);
Props
| Name | Type | Optional | Default | Description |
| ---------------|-----------------------------|------------|-----------|-------------------------------------------------|
| source
| string | | | Value path, lodash get()
style. |
| createRows
| (value: any) => string[]
| | | Create the possible forms from the given value. |
| iconPosition
| "left"
"right"
"none"
| Optional | "right"
| Icon position in relation to the field. |
Run the demo
git clone https://github.com/OoDeLally/react-admin-clipboard-list-field.git
cd react-admin-clipboard-list-field
npm install
npm run demo-install
npm run demo