Skip to main content

Checkboxes

MNCheckboxes

These components are part of a React Native UI library to render customizable checkboxes and checkbox groups with a consistent theme.


Import

import {MNCheckbox} from '@/components/ui/forms/checkboxes/MNCheckBoxes';

Props

PropTypeRequiredDefaultDescription
labelstringNo-Group label displayed above the checkboxes
optionsstring[]Yes-Array of option labels/values
selectedValuesstring[]Yes-Currently selected checkbox values
onChange(value: string[]) => voidNo-Callback when selection changes
direction`'row''column'`No'row'
editablebooleanNotrueWhether checkboxes are editable

Usage Example

<MNCheckboxes
label="Select Interests"
options={['Music', 'Movies', 'Books']}
selectedValues={selectedInterests}
onChange={(newValues) => setSelectedInterests(newValues)}
direction="column"
/>

MNCheckBoxWithLongLabel

A customizable checkbox component with a long descriptive label and a progress line separator.

Import

import MNCheckBoxWithLongLabel from '@/components/ui/forms/checkboxes/MNCheckBoxWithLongLabel';

Props

PropTypeRequiredDefaultDescription
descstringYes-The descriptive label text shown beside the checkbox
isCheckedbooleanNofalseInitial checked state of the checkbox
lastRowbooleanNofalseIf true, removes the bottom border line
onToggle(isChecked: boolean) => voidYes-Callback function called when checkbox state toggles
editablebooleanNotrueIf false, disables interaction and styles label as disabled

Usage Example

 <MNCheckBoxWithLongLabel
key={index}
desc={label}
isChecked={false}
onToggle={(isChecked) =>
debug(isChecked, 'Checkbox is checked or not?')
}
lastRow={details.milestonesCheckList.length - 1 == index}
/>

NOTE: All example can be founded in checkboxes.tsx