@culur/antd-number-picker
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

@culur/antd-number-picker

Ant design number picker.

Npm version Downloads/month GitHub issues

Renovate enabled Main Publish CodeFactor

Install

Add @culur/antd-number-picker dependency to your project.

# Using npm
npm install @culur/antd-number-picker

# Using yarn
yarn add @culur/antd-number-picker

Usage

Standalone

function Example() {
  const [value, setValue] = setState(0);

  return (
    <AntdNumberPicker
      min={0}
      max={10}
      value={value}
      onChange={(value_) => setValue(value_)}
    />
  );
}

Antd form

function Example() {
  type FormValues = { number: number };
  const [form] = Form.useForm<FormValues>();

  const onFinish = (values: FormValues) => {
    console.log(`form values: ${values.number}`);
  };

  return (
    <Form
      layout="inline"
      form={form}
      onFinish={onFinish}
      initialValues={{
        number: 3,
      }}
    >
      <Form.Item name="number">
        <AntdNumberPicker min={0} max={10} />
      </Form.Item>
      <Form.Item>
        <Button type="primary" htmlType="submit">
          Submit
        </Button>
      </Form.Item>
    </Form>
  );
}

Props

Property Description Type Default Required
className InputNumber className string - -
min The min value number - true
max The max value number - true
readOnly If readonly the input boolean false -
placement The position of the tooltip relative to the target, which can be one of top left right bottom topLeft topRight bottomLeft bottomRight leftTop leftBottom rightTop rightBottom string bottomLeft -
trigger Tooltip trigger mode. Could be multiple by passing an array hover | focus | click | contextMenu | string[] click -
cols Number of cols in popover number 7 -
rows Number of rows in popover number 7 -
value The current value number - -
onChange The callback triggered when the value is changed function(value: number | string | null) - -

License

@culur/antd-number-picker is released under the GNU GPLv3 license.

Readme

Keywords

Package Sidebar

Install

npm i @culur/antd-number-picker

Weekly Downloads

4

Version

0.0.6

License

GNU GPLv3

Unpacked Size

486 kB

Total Files

7

Last publish

Collaborators

  • phamhongphuc