# NumberKeyboard
### Install
```js
import { createApp } from 'vue';
import { NumberKeyboard } from 'vant';
const app = createApp();
app.use(NumberKeyboard);
```
## Usage
### Default Keyboard
```html
Show Keyboard
```
```js
import { Toast } from 'vant';
export default {
data() {
return {
show: true,
};
},
methods: {
onInput(value) {
Toast(value);
},
onDelete() {
Toast('delete');
},
},
};
```
### Keyboard With Sidebar
```html
```
### IdNumber Keyboard
Use `extra-key` prop to set the content of bottom left button.
```html
Show IdNumber Keyboard
```
### Keyboard With Title
Use `title` prop to set keyboard title.
```html
Show Keyboard With Title
```
### Multiple ExtraKey
```html
Show Keyboard With Multiple ExtraKey
```
### Bind Value
```html
```
```js
export default {
data() {
return {
show: false,
value: '',
};
},
};
```
## API
### Props
| Attribute | Description | Type | Default |
| --- | --- | --- | --- |
| v-model (value) | Current value | _string_ | - |
| show | Whether to show keyboard | _boolean_ | - |
| title | Keyboard title | _string_ | - |
| theme | Keyboard themeļ¼can be set to `custom` | _string_ | `default` |
| maxlength | Value maxlength | _number \| string_ | - |
| transition | Whether to show transition animation | _boolean_ | `true` |
| z-index | Keyboard z-index | _number \| string_ | `100` |
| extra-key `v2.8.2` | Content of bottom left key | _string \| string[]_ | `''` |
| close-button-text | Close button text | _string_ | - |
| delete-button-text | Delete button text | _string_ | Delete Icon |
| close-button-loading `v2.7.0` | Whether to show loading close button in custom theme | _boolean_ | `false` |
| show-delete-key `v2.5.9` | Whether to show delete button | _boolean_ | `true` |
| hide-on-click-outside | Whether to hide keyboard when click outside | _boolean_ | `true` |
| teleport `v2.10.0` | Return the mount node for NumberKeyboard | _string \| Element_ | - |
| safe-area-inset-bottom | Whether to enable bottom safe area adaptation | _boolean_ | `true` |
### Events
| Event | Description | Arguments |
| --- | --- | --- |
| input | Triggered when keydown | key: Content of the key |
| delete | Triggered when press delete key | - |
| close | Triggered when click close button | - |
| blur | Triggered when click close button or blur keyboard | - |
| show | Triggered when keyboard is fully displayed | - |
| hide | Triggered when keyboard is fully hidden | - |
### Slots
| Name | Description |
| ---------- | ------------------------- |
| delete | Custom delete key content |
| extra-key | Custom extra key content |
| title-left | Custom title left content |