0.46.1 • Published 12 months ago

@clds/number-field-old v0.46.1

Weekly downloads
-
License
-
Repository
github
Last release
12 months ago

@clds/number-field-old


npm version

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

12 months ago

0.46.1

12 months ago

0.45.3

1 year ago

0.44.4

1 year ago

0.45.1

1 year ago

0.44.2

1 year ago

0.45.2

1 year ago

0.44.3

1 year ago

0.44.0

1 year ago

0.45.0

1 year ago

0.44.1

1 year ago

0.43.1

1 year ago

0.43.0

1 year ago

0.42.4

1 year ago

0.42.3

1 year 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