Skip to content
brandonk1234 edited this page Feb 23, 2017 · 2 revisions

Toggle

This ui element displays to the user an on or off looking choice.

Props

The props needed for this component are listed and explained below:

  • initialValue - This prop must be a boolean.

  • toggleId - This prop must be a string.

  • onChange - This prop must be a function.

Example

<Toggle 
    initialValue={false}
    toggleId="toggle-id"
    onChange={this.onChange}
/>

// ...React Component
onChange: function() {
    console.log("This component has been changed");
}

Related