Skip to content

MfCheckbox

Checkbox with optional label and nested content. Uses theme colors for the surface and text, with hardcoded black/white for the checkbox indicator itself.

Usage

tsx
import { MfCheckbox } from '@zyno-io/mobile-foundation-rn';

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

// Basic
<MfCheckbox value={checked} onPress={() => setChecked(!checked)} label="I agree to the terms" />

// With nested content
<MfCheckbox value={checked} onPress={() => setChecked(!checked)} label="Enable notifications">
    <MfText>You'll receive push notifications for new messages.</MfText>
</MfCheckbox>

// Disabled
<MfCheckbox value={true} disabled label="Required" />

Props

PropTypeDefaultDescription
valuebooleanfalseChecked state
onPress() => voidToggle handler
disabledbooleanfalseDisable interaction
iconIconPropConfig check iconCustom check icon
labelstringLabel text beside the checkbox
wrapperStyleViewStyleStyle for the outer container
unstyledbooleanfalseRemove default wrapper styling (padding, border)
childrenReactNodeContent rendered below, indented under the label

Theming

  • colors.surface — checkbox background
  • colors.text — label text color
  • Checkbox indicator uses hardcoded black/white for the border and check icon