Skip to content

Commit

Permalink
Documentation for 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-ignatov committed Jul 30, 2017
1 parent 643d20e commit 17ba564
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

2.0.8
--------------------------------------------------------------------------------
Fixed `React.PropTypes` reference warnings
* Fixed `React.PropTypes` reference warnings

2.0.7
--------------------------------------------------------------------------------
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ floating point numbers:
<NumericInput step={0.1} precision={2} value={50.3}/>
```

#### Snap to step
If you want your component to "snap" to the closest step value while incrementing
or decrementing (up/down buttons or arrow keys) you can use the `snap` prop:
```jsx
<NumericInput step={0.5} precision={2} value={50.3} snap/>
```

#### Custom format
By default the component displays the value number as is. However, you can
provide your own `format` function that will be called with the numeric value
Expand Down Expand Up @@ -73,6 +80,7 @@ Name | Type | Default
**style** |`object` or `false` | none
**size** |`number` or `string` | none
**mobile** |`true`, `false`, 'auto' or `function`|`auto`
**snap** |`boolean` | none (false)

Any other option is passed directly the input created by the component. Just
don't forget to camelCase the attributes. For example `readonly` must be `readOnly`.
Expand Down

0 comments on commit 17ba564

Please sign in to comment.