# YesNo
This page contains all possible variations of the REACT YesNo component.
Used to render a YesNo input.
# Default
<GocoYesNo
id='test-id'
onChange={onChangeHandler}
/>
# Checked - Yes
<GocoYesNo
id='test-id'
onChange={onChangeHandler}
checked
// or checked={true}
/>
# Checked - No
<GocoYesNo
id='test-id'
onChange={onChangeHandler}
checked={false}
/>
# Extra Classes
<GocoYesNo
id='test-id'
onChange={onChangeHandler}
className='test-class-1'
/>
# Component props
Prop | Type | Default | Required | Description |
---|---|---|---|---|
id | String | true | Adds an id attribute to the YesNo input. It must be unique with no spaces. | |
onChange | (newValue: boolean) => void | true | Handler to be called when change event is triggered. | |
checked | Boolean | false | Selects yes when true and no when false. If not present, nothing is selected | |
className | String | true | Allows the addition of extra classes. (Separated by a space) |