Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/culur/antd-number-picker

Ant design number picker
https://github.com/culur/antd-number-picker

antd number-picker

Last synced: 11 days ago
JSON representation

Ant design number picker

Awesome Lists containing this project

README

        

# @culur/antd-number-picker

> Ant design number picker.

[![Npm version](https://img.shields.io/npm/v/@culur/antd-number-picker.svg)](https://www.npmjs.com/package/@culur/antd-number-picker)
[![Downloads/month](https://img.shields.io/npm/dm/@culur/antd-number-picker.svg)](http://www.npmtrends.com/@culur/antd-number-picker)
[![GitHub issues](https://img.shields.io/github/issues/culur/antd-number-picker)](https://github.com/culur/antd-number-picker/issues)

[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
[![Main](https://github.com/culur/antd-number-picker/actions/workflows/main.yml/badge.svg)](https://github.com/culur/antd-number-picker/actions/workflows/main.yml)
[![Publish](https://github.com/culur/antd-number-picker/actions/workflows/publish.yml/badge.svg)](https://github.com/culur/antd-number-picker/actions/workflows/publish.yml)
[![CodeFactor](https://www.codefactor.io/repository/github/culur/antd-number-picker/badge)](https://www.codefactor.io/repository/github/culur/antd-number-picker)

## Install

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

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

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

## Usage

### Standalone

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

return (
setValue(value_)}
/>
);
}
```

### Antd form

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

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

return (






Submit



);
}
```

## 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.