rslabdocs

Checkbox & Radio

A checkbox with a quick pop-in checkmark and a radio group with an animated selection ring, both with matching haptics.

ReanimatedHapticsNativeWindSource

Prerequisites

Both controls are plain Reanimated and haptics, no icon set beyond the checkmark already bundled with the library's icons component.


npx expo install react-native-reanimated expo-haptics react-native-css

Install


npx @rslab/cli add checkbox

Usage

import { Checkbox } from '@/components/ui/Checkbox';

const [agreed, setAgreed] = useState(false);

<Checkbox checked={agreed} onChange={setAgreed} label="I agree to the terms" />;
import { RadioGroup } from '@/components/ui/Radio';

const [plan, setPlan] = useState('solo');

<RadioGroup
  value={plan}

  onChange={setPlan}

  options={[
    { label: 'Solo', value: 'solo' },

    { label: 'Team', value: 'team' },
  ]}
/>;

Props

Checkbox

PropTypeDefault
checked
boolean
-
onChange
(checked: boolean) => void
-
label?
string
-

Optional label rendered next to the box.

disabled?
boolean
false

Fades the row and blocks toggling.

haptic?
boolean
true

Light haptic tick on toggle. Set false to mute it.

className?
string
-

Extend or override the outer row.

RadioGroup

PropTypeDefault
value
T
-
onChange
(value: T) => void
-
options
{ label: string; value: T }[]
-

Generic over the value’s string literal type, so unions narrow correctly.

disabled?
boolean
false

Fades the group and blocks selection.

haptic?
boolean
true

Selection tick on picking a new option.

className?
string
-

Extend or override the outer wrapper.

See exactly how this works with an RSLAB subscription.

Get Pro

On this page