Input Copy

Install

import {InputCopy} from '@xsolla/uikit';

Examples

Default
Copies input value to clipboard by icon click
With text selection
Selects field text (you can press copy keys manually)
With onCopy event callback
Copies value and fires onCopy callback (shown in console)
Editable with error messages
Error message
Editable CopyInput with error

Usage

<InputCopy
  selectOnClick
  input={{
    value: 'Some value',
  }}
/>

API

PropertyDescriptionTypeDefault
inputconfig for redux-form or basic inputobject{}
typecan be set to text, email, passwordstringtext
sizecan be set to xs, sm, mdstringmd
inlineinline input renderbooleanfalse
onClickcallback function that is fired on field onClick eventevent => void 0
selectOnClickselect value by click on field, replaces onClick eventbooleanfalse
readOnlyprohibits editing textbooleantrue
onCopycallback function that is fired on click by icon, but not replaces main copy funcitonevent => void 0
metameta for redux-form or basic inputobject{touched: false, error: null}
validationAppearancecan be set to default, highlightstringnull
dataIdErrorAttribute for data identifierstringnull
notificationClassNameset the className of input notificationstringnull