2019-08-23 15:20:22 +02:00
|
|
|
Set of radio Bootstrap component input with label and predefined sizes and structure for using in foris forms.
|
|
|
|
|
|
|
|
All additional `props` are passed to the `<input type="number">` HTML component.
|
|
|
|
|
|
|
|
```js
|
|
|
|
import {useState} from 'react';
|
|
|
|
const CHOICES=[
|
|
|
|
{value:'one',label:'1'},
|
|
|
|
{value:'two',label:'2'},
|
|
|
|
{value:'three',label:'3'},
|
|
|
|
];
|
|
|
|
const [value, setValue] = useState(CHOICES[0].value);
|
|
|
|
|
|
|
|
<>
|
|
|
|
{/*Yeah, it gets event, not value!*/}
|
|
|
|
<RadioSet
|
|
|
|
value={value}
|
|
|
|
name='some-radio'
|
|
|
|
choices={CHOICES}
|
2019-09-25 15:43:37 +02:00
|
|
|
onChange={e => setValue(e.target.value)}
|
2019-08-23 15:20:22 +02:00
|
|
|
/>
|
|
|
|
<p>Selected value: {value}</p>
|
|
|
|
</>
|
|
|
|
```
|