Skip to content

Components Overview

React Native Jetpack Compose provides 8 native Android components built on Jetpack Compose and Material 3.

ComponentDescription
TextFieldMaterial 3 text input with labels, icons, validation, and keyboard options
PickerDropdown picker using ExposedDropdownMenuBox
SheetPickerSearchable picker with a modal bottom sheet
ComponentDescription
DatePickerDate selection with calendar dialog
DateRangePickerSelect start and end dates
TimePickerTime selection with dial or keyboard input
TimeRangePickerSelect start and end times
ComponentDescription
ModalBottomSheetDraggable bottom sheet for custom content

All components are exported from the main package:

import {
TextField,
Picker,
SheetPicker,
DatePicker,
DateRangePicker,
TimePicker,
TimeRangePicker,
ModalBottomSheet,
} from '@mgcrea/react-native-jetpack-compose';

All input components follow the controlled component pattern:

const [value, setValue] = useState('');
<TextField value={value} onChange={setValue} />

Date and time pickers show a dialog when tapped. They use a confirm/cancel pattern:

const [date, setDate] = useState<Date | null>(null);
<DatePicker
value={date}
onConfirm={setDate} // User pressed OK
onCancel={() => {}} // User pressed Cancel
onChange={() => {}} // Value changed (before confirm)
/>

All components accept a style prop for container styling:

<TextField
label="Name"
value={name}
onChange={setName}
style={{ marginBottom: 16, marginHorizontal: 8 }}
/>

Material 3 theming is applied automatically based on your Android system theme.

All components support a disabled prop:

<TextField disabled label="Read Only" value="Cannot edit" />
<DatePicker disabled label="No Date Selection" />
<Picker disabled label="No Selection" options={[]} />