RN Neo
Components

Checkbox

Toggleable checkbox with a press animation

A toggleable checkbox with a press animation and a built-in checkmark. Supports a disabled state, custom sizes, and separate colors for checked / unchecked states.

Usage

import { Checkbox } from 'rn-neo';
import { useState } from 'react';

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

<Checkbox checked={checked} onChange={setChecked} />

// With size and custom colors
<Checkbox
  checked={checked}
  onChange={setChecked}
  size="lg"
  backgroundColor={{ true: 'secondary', false: 'surface' }}
  checkColor={{ true: 'onSecondary', false: 'transparent' }}
/>

// Disabled
<Checkbox checked={checked} onChange={setChecked} disabled />

Behavior

  • Pressing calls onChange with the toggled value.
  • On press it shifts on both axes to simulate the shadow being pushed in.
  • When disabled, it renders at reduced opacity and ignores interactions.
  • The checkmark uses the internal NeoIcons font, sized at 70% of the container.
  • Color / shadow / transform transitions animate when animation is enabled.

Size

size controls the width and height of the container; the checkmark scales with it.

SizeDimensions
sm18 × 18
md22 × 22
lg28 × 28

Props

Checkbox

PropTypeDefaultDescription
checkedbooleanRequiredCurrent checked state.
onChange(checked: boolean) => voidRequiredCalled with the new value on press.
disabledbooleanDisables interaction and reduces opacity.
size'sm' | 'md' | 'lg''md'Controls the dimensions of the checkbox.
backgroundColorRecord<'true' | 'false', BgColors | string>{ true: 'primary', false: 'surface' }Background color for each state.
checkColorRecord<'true' | 'false', Colors | string>{ true: 'onPrimary', false: 'transparent' }Checkmark color for each state.

Border

PropTypeDefaultDescription
borderbooleanFrom themeWhether to show a border.
borderSizeBorderSize | numberFrom themeBorder width. Token or raw number.
borderColorColors | stringFrom themeBorder color.
radiusRadius | numberFrom themeBorder radius. Token or raw number.

Shadow

PropTypeDefaultDescription
shadowbooleanFrom themeWhether to show a shadow.
shadowSizeShadowSize | numberFrom themeShadow offset size. Token or raw number.
shadowColorColors | stringFrom themeShadow color.

Spacing

Accepts all standard spacing props (padding*, margin*). See Box → Spacing for the full list.

Accessibility

Checkbox sets accessibilityRole="checkbox" and passes checked and disabled to accessibilityState automatically.

On this page