fk-react-ui-components
Version:
Step 1 : Create a file in [ Seeds / Plants / Trees ] <br> Step 2 : It should export an Object with component name and story Component [Refer other components] <br> Step 3 : Story Component should return a react component <br> Step 3 : Created file should
35 lines (31 loc) • 954 B
JavaScript
import React from 'react';
import classname from 'classnames';
import styled from 'styled-components';
const RadioStyled = styled.input`
margin: 10px;
`;
const RadioLabel = styled.label`
text-align: center;
`;
export class RadioButton extends React.PureComponent {
render() {
return (
<div>
<RadioStyled
checked={this.props.selected}
type='radio'
name={this.props.name}
value={this.props.value}
id={this.props.id}
style={this.props.style}
className={this.props.className}
onChange={this.props.onChange}
disabled={this.props.disabled}
/>
<RadioLabel className={this.props.labelClass}>
{this.props.label}
</RadioLabel>
</div>
);
}
}