2021-10-17 18:26:00 +02:00
|
|
|
---
|
|
|
|
title: counter
|
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-02-05 17:44:23 +01:00
|
|
|
For a given number of things, use a counter option.
|
2021-08-25 16:09:31 +02:00
|
|
|
Counters are for integers only. Things like number of buttons and so on.
|
|
|
|
|
2022-02-05 17:44:23 +01:00
|
|
|
## Structure
|
|
|
|
|
|
|
|
Your counter option should be a plain object with these properties:
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-02-20 14:44:38 +01:00
|
|
|
- `count` : The default integer value
|
|
|
|
- `min` : The minimal integer value that's allowed
|
|
|
|
- `max` : The maximum integer value that's allowed
|
|
|
|
- `hide` <small>(optional)</small> : A method to [control the optional display of the option][hide]
|
2022-02-05 17:44:23 +01:00
|
|
|
|
|
|
|
[hide]: /reference/api/config/options#optionally-hide-options-by-configuring-a-hide-method
|
|
|
|
|
|
|
|
## Example
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
```js
|
|
|
|
options: {
|
|
|
|
butttons: {
|
|
|
|
count: 7,
|
|
|
|
min: 4,
|
|
|
|
max: 12
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|