Skip to content
Closed
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
59 changes: 58 additions & 1 deletion src/framework/ui/checkbox/checkbox.component.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

import React from 'react';
import {
View,
Expand All @@ -18,11 +24,62 @@ import {
} from '../text/text.component';
import { CheckMark } from '../drawable/checkmark/checkmark.component';

/**
* The `Checkbox` component is an analog of html checkbox button.
*
* @extends React.Component
*
* @property {boolean} checked - Determines whether component is checked.
*
* @property {boolean} disabled - Determines whether component is disabled.
* By default is false.
*
* @property {string} status - Determines the status of the component.
* Can be 'primary' | 'success' | 'info' | 'warning' | 'danger'.
* By default status is 'primary'.
*
* @property {string} text - Determines text of the component.
*
* @property {(checked: boolean) => void} onChange - Triggered on change value.
*
* @example Simple usage example
*
* ```tsx
* import { Toggle } from '@kitten/ui';
* <Checkbox checked={true}/>
* ```
*
* ### Usage
*
* @example
*
* ```tsx
* import { Checkbox } from '@kitten/ui';
*
* state: State = {
* checked: false,
* };
*
* private onChange = (checked: boolean): void => {
* this.setState({ checked: checked });
* };
*
* public render(): React.ReactNode {
* return (
* <Checkbox
* checked={this.state.toggled}
* status='info'
* text='Place your text'
* onChange={this.onChange}/>
* );
* }
* ```
* */

interface CheckBoxProps {
text?: string;
checked?: boolean;
status?: string;
size?: string;
onChange?: (checked: boolean) => void;
}

Expand Down