Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ Circle-style checkbox component for React Native.
- `label` : Checkbox label. Default: empty
- `labelPosition` : Label rendering position. Default: `right`, may be 'right' or 'left'
- `styleCheckboxContainer`: Styles for checkbox container.
- `styleLabel`: Styles for label.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class CircleCheckBox extends Component {
onToggle: React.PropTypes.func.isRequired,
labelPosition: React.PropTypes.oneOf(['right', 'left']),
styleCheckboxContainer: View.propTypes.style,
styleLabel: View.propTypes.style,
};

static defaultProps = {
Expand All @@ -40,7 +41,8 @@ class CircleCheckBox extends Component {
filterColor: '#FFF',
innerColor: '#FC9527',
label: '',
labelPosition: 'right'
labelPosition: 'right',
styleLabel: {}
};

constructor(props) {
Expand Down Expand Up @@ -104,7 +106,7 @@ class CircleCheckBox extends Component {
_renderLabel(position) {
var templ = (<View></View>);
if ((this.props.label.length > 0) && (position === this.props.labelPosition)) {
templ = (<Text style={styles.checkBoxLabel}>{this.props.label}</Text>);
templ = (<Text style={[styles.checkBoxLabel, this.props.styleLabel]}>{this.props.label}</Text>);
}
return templ;

Expand Down