Skip to main content

CheckBox

CheckBox allows the user to select one or more items from a set. It supports checked, unchecked, and indeterminate states.

Import

import { CheckBox } from '@ui-kitten/components';

Basic Usage

import React, { useState } from 'react';
import { Layout, CheckBox } from '@ui-kitten/components';

const CheckBoxExample = () => {
const [checked, setChecked] = useState(false);

return (
<Layout style={{ flex: 1, padding: 16 }}>
<CheckBox
checked={checked}
onChange={(nextChecked) => setChecked(nextChecked)}
>
Accept Terms
</CheckBox>

<CheckBox
checked={true}
indeterminate={true}
status="warning"
>
Indeterminate
</CheckBox>
</Layout>
);
};

Props

PropertyTypeDefaultDescription
checkedbooleanfalseWhether the checkbox is checked.
indeterminatebooleanfalseWhether the checkbox displays an indeterminate state.
onChange(checked: boolean) => void-Called when the checkbox value changes.
status'basic' | 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'control''basic'Semantic color of the checkbox.
childrenReactText | (props) => ReactElementundefinedLabel text or render function displayed next to the checkbox.

Storybook

Live examples coming soon via Storybook.