Skip to content

Demos

Empty

<DataInput.Number onChange={(value) => console.log('onChange', value)} />

Placeholder

<DataInput.Number
placeholder="Enter a number"
onChange={(value) => console.log('onChange', value)}
/>

Label

<DataInput.Number
label="Label text"
onChange={(value) => console.log('onChange', value)}
/>

Label and value

<DataInput.Number
value={420000}
label="Label text"
onChange={(value) => console.log('onChange', value)}
/>

Disabled

<DataInput.Number
value={135}
label="Label text"
onChange={(value) => console.log('onChange', value)}
disabled
/>

Info

Useful information (?)
<DataInput.Number
value={135}
label="Label text"
onChange={(value) => console.log('onChange', value)}
info="Useful information (?)"
/>

Warning

I'm warning you...
<DataInput.Number
value={135}
label="Label text"
onChange={(value) => console.log('onChange', value)}
warning={new FormError("I'm warning you...")}
/>

Error

This is what is wrong...
<DataInput.Number
value={135}
label="Label text"
onChange={(value) => console.log('onChange', value)}
error={new FormError('This is what is wrong...')}
/>

Validation - Required

<DataInput.Number
value={123}
label="Remove and blur field"
onChange={(value) => console.log('onChange', value)}
required
/>

Validation - Minimum

<DataInput.Number
value={300}
label="Enter a number below 250 and blur to trigger error"
onChange={(value) => console.log('onChange', value)}
minimum={250}
/>

Validation - Maximum and custom error message

<DataInput.Number
value={200}
label="Enter a number above 250 and blur to trigger error"
onChange={(value) => console.log('onChange', value)}
maximum={250}
errorMessages={{
maximum: "You can't enter a number THAR large.. Max 250!",
}}
/>