0.46.1 • Published 9 months ago
@clds/number-field-old v0.46.1
@clds/number-field-old
Documentation of the number field component.
Installation
Install the package using Yarn:
yarn add @cld/number-field
Props
Most props are identical to @clds/text-field
Components
NumberField
Controlled/Uncontrolled number field component
Adds custom up/down buttons to control the value from the UI
Usage
import React, { FC, useRef, useState } from 'react';
import TextField from '@clds/text-field-old';
export const ControlledUsage = () => {
const [value, setValue] = useState(0);
return <NumberField placeholder="Enter number here" value={value} onChange={setValue} />;
};
export const UncontrolledUsage = () => {
const inputRef = useRef < HTMLInputElement > null;
const handleButtonClick = () => alert(inputRef.current?.value);
return (
<>
<NumberField inputRef={inputRef} />
<br />
<button onClick={handleButtonClick}>Alert current field value</button>
</>
);
};
Versioning
This library follows Semantic Versioning.
License
See LICENSE
0.46.0
10 months ago
0.46.1
9 months ago
0.45.3
10 months ago
0.44.4
10 months ago
0.45.1
10 months ago
0.44.2
11 months ago
0.45.2
10 months ago
0.44.3
10 months ago
0.44.0
11 months ago
0.45.0
10 months ago
0.44.1
11 months ago
0.43.1
11 months ago
0.43.0
11 months ago
0.42.4
12 months ago
0.42.3
12 months ago
0.42.2
1 year ago
0.42.1
1 year ago
0.42.0
1 year ago
0.41.1
1 year ago
0.41.0
1 year ago