forked from yuristrelets/react-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathradio.js
More file actions
39 lines (32 loc) · 1.04 KB
/
radio.js
File metadata and controls
39 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from 'react';
import { RadioGroup, RadioButton } from '../../components/radio';
class RadioGroupTest extends React.Component {
state = {
value: 'vvendetta'
};
handleChange = (value) => {
console.log('Changed!', { comic: value});
this.setState({value});
};
handleFocus = () => {
console.log('Focused V for a Vendetta');
};
handleBlur = () => {
console.log('Blurred Watchmen');
};
render () {
return (
<section>
<h5>Radio Button</h5>
<p style={{marginBottom: '10px'}}>Lorem ipsum...</p>
<RadioGroup name='comic' value={this.state.value} onChange={this.handleChange}>
<RadioButton label='The Walking Dead' value='thewalkingdead'/>
<RadioButton label='From Hell' value='fromhell' disabled/>
<RadioButton label='V for a Vendetta' value='vvendetta' onFocus={this.handleFocus}/>
<RadioButton label='Watchmen' value='watchmen' onBlur={this.handleBlur}/>
</RadioGroup>
</section>
);
}
}
export default RadioGroupTest;