CheckboxField is a controlled checkbox presented as a pressable field.
Usage
Props
It accepts
PressableProps except children, onPress, and style.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Toggle a labeled boolean value with validation feedback
CheckboxField is a controlled checkbox presented as a pressable field.
import { useState } from 'react';
import { CheckboxField } from '@amisi-mobile-starter/ui';
export const TermsField = () => {
const [isAccepted, setIsAccepted] = useState(false);
return (
<CheckboxField
label="I accept the terms"
value={isAccepted}
onValueChange={setIsAccepted}
helperText="Required before you continue."
/>
);
};
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | Required | Checkbox label. |
value | boolean | Required | Controlled checked state. |
onValueChange | (nextValue: boolean) => void | Required | Receives the inverted value after a press. |
helperText | string | undefined | Supporting text shown when there is no error. |
error | string | undefined | Error shown instead of helper text. |
containerStyle | StyleProp<ViewStyle> | undefined | Style for the outer wrapper. |
PressableProps except children, onPress, and style.Was this page helpful?