diff --git a/src/components/Checkbox/Checkbox.tsx b/src/components/Checkbox/Checkbox.tsx index 69e6bf2b..628ea917 100644 --- a/src/components/Checkbox/Checkbox.tsx +++ b/src/components/Checkbox/Checkbox.tsx @@ -2,15 +2,17 @@ import React, { Component } from 'react' import FormCheck from 'react-bootstrap/FormCheck' interface Props { + /** The id for the checkbox */ + id?: string /** The label to render next to the checkbox */ label: string /* Determines the side of the checkbox to render the label on. By default right */ labelSide?: 'right' | 'left' - /* Gives the checkbox a name */ + /** Gives the checkbox a name */ name?: string - /* Determines if the checkbox should be disabled or not. By default false */ + /** Determines if the checkbox should be disabled or not. By default false */ disabled?: boolean - /* Determines if the checkbox should render inline or not. By default false. */ + /** Determines if the checkbox should render inline or not. By default false. */ inline?: boolean /** The onChange listener */ onChange?: (event: React.ChangeEvent) => void @@ -26,13 +28,18 @@ class Checkbox extends Component { return ( - {labelSide === 'left' && {this.props.label}} + {labelSide === 'left' && ( + {this.props.label} + )} - {labelSide === 'right' && {this.props.label}} + {labelSide === 'right' && ( + {this.props.label} + )} ) } diff --git a/stories/checkbox.stories.tsx b/stories/checkbox.stories.tsx index 8a6d5638..c206de7b 100644 --- a/stories/checkbox.stories.tsx +++ b/stories/checkbox.stories.tsx @@ -12,13 +12,13 @@ storiesOf('Checkbox', module) .add('Checkbox', () => (

Vertical

- - - + + +

Horizontal

- - - + + +
))