Skip to Content
ARCUI

Checkbox

Controlled boolean or grouped selection control with ARCUI validation, motion, press feedback, and accessibility semantics.

Checkbox supports two explicit ownership modes while keeping selection motion, validation, press feedback, theming, and accessibility behavior consistent.

Usage

Standalone Checkbox is controlled. The consumer owns checked and updates it from onCheckedChange.

import { Checkbox } from "react-native-arc-ui";
import { useState } from "react";

export function Example() {
  const [checked, setChecked] = useState(false);

  return (
    <Checkbox checked={checked} onCheckedChange={setChecked}>
      Remember this device
    </Checkbox>
  );
}

Checkbox does not mutate semantic selection state internally. It reports the requested next value and lets the owner decide whether to accept it.

Ownership modes

Checkbox models standalone and grouped selection as mutually exclusive public states.

Standalone

Outside SelectionGroup, pass checked.

<Checkbox checked={accepted} onCheckedChange={setAccepted}>
  Accept terms
</Checkbox>

Passing value outside SelectionGroup is invalid.

SelectionGroup

Inside SelectionGroup, pass value and let the group own selection.

import { Checkbox, SelectionGroup } from "react-native-arc-ui";
import { useState } from "react";

export function Preferences() {
  const [values, setValues] = useState<string[]>([]);

  return (
    <SelectionGroup multiple values={values} onValuesChange={setValues}>
      <Checkbox value="product">Product updates</Checkbox>
      <Checkbox value="marketing">Marketing</Checkbox>
    </SelectionGroup>
  );
}

Grouped Checkbox supports both single and multiple SelectionGroup modes. Inside a group, checked must not be provided because the group is the semantic state owner.

Child-level onCheckedChange remains optional. It is called only when the group resolves an actual resulting checked-state change, not merely because the control was pressed.

States

Checked and unchecked

The checked state controls the checkmark and checked background. Unchecked state remains transparent while preserving the active border treatment.

Error

A non-empty error string enables the validation state and renders an accessible alert row.

<Checkbox
  checked={accepted}
  error={accepted ? undefined : "Required"}
  onCheckedChange={setAccepted}
>
  Accept terms
</Checkbox>

The validation message is represented separately from the label so the main label remains readable while the error border and alert communicate validation.

Inactive

Use active={false} when the control should remain visible in the interaction flow but should not be actionable.

<Checkbox checked={true} active={false}>
  Included by your plan
</Checkbox>

Inactive has its own tokenized presentation and prevents native press interaction.

Disabled

Use native disabled for fully disabled semantics.

<Checkbox checked={true} disabled>
  Locked setting
</Checkbox>

Disabled has visual priority over inactive and error states and is exposed through native accessibility state.

Press animations

animation overrides the configured ARCUI press feedback for one Checkbox.

<Checkbox checked={checked} onCheckedChange={setChecked} animation="scaleDown">
  Scale down
</Checkbox>

<Checkbox checked={checked} onCheckedChange={setChecked} animation="scaleUp">
  Scale up
</Checkbox>

<Checkbox checked={checked} onCheckedChange={setChecked} animation="highlight">
  Highlight
</Checkbox>

<Checkbox checked={checked} onCheckedChange={setChecked} animation="none">
  No ARCUI press motion
</Checkbox>

When animation is omitted, Checkbox uses tokens.pressAnimation.type.

Reduced Motion removes geometric scaling. Scale modes fall back to pressed-color feedback so interaction remains visible without movement.

Size

size overrides the outer Checkbox box size for one instance.

<Checkbox checked={small} size={18} onCheckedChange={setSmall}>
  Compact
</Checkbox>

<Checkbox checked={large} size={30} onCheckedChange={setLarge}>
  Large
</Checkbox>

The check icon resolves from the available box geometry and preserves space for the configured Checkbox border.

Label and custom content

Text-resolvable children receive ARCUI Checkbox typography, central font scaling, theme-aware colors, and a default accessibility label derived from the text.

<Checkbox checked={checked} onCheckedChange={setChecked}>
  Send weekly summary
</Checkbox>

Use textStyle for consumer styling of textual content.

<Checkbox
  checked={checked}
  onCheckedChange={setChecked}
  textStyle={{ fontWeight: "600" }}
>
  Priority option
</Checkbox>

Custom React content is also valid:

<Checkbox
  checked={checked}
  onCheckedChange={setChecked}
  accessibilityLabel="Enable premium alerts"
>
  <CustomPreferenceRow />
</Checkbox>

Custom content remains consumer-owned. Provide an explicit accessibilityLabel when the accessible meaning cannot be derived from text.

Styling and native Pressable props

Checkbox inherits its supported action surface from React Native PressableProps.

<Checkbox
  checked={checked}
  onCheckedChange={setChecked}
  hitSlop={10}
  style={{ marginTop: 12 }}
  accessibilityHint="Adds product announcements to your preferences"
>
  Product updates
</Checkbox>

The inherited style applies to the outer Pressable. textStyle applies only to ARCUI-rendered textual Checkbox content.

Press callbacks

Native press callbacks remain available in addition to onCheckedChange.

<Checkbox
  checked={checked}
  onCheckedChange={setChecked}
  onPress={() => analytics.track("preference_pressed")}
  onPressIn={() => console.log("press in")}
  onPressOut={() => console.log("press out")}
>
  Product updates
</Checkbox>

onCheckedChange represents selection semantics. onPress remains the normal native action callback. Inactive and disabled states prevent the press lifecycle from starting.

Testing

Use testID on the public root when the control needs stable automation identity.

<Checkbox
  testID="terms-checkbox"
  checked={accepted}
  onCheckedChange={setAccepted}
>
  Accept terms
</Checkbox>

ARCUI also exposes stable descendants for ARCUI-owned content:

terms-checkbox-box
terms-checkbox-label
terms-checkbox-error-row
terms-checkbox-error

The error descendants exist only while a non-empty error is rendered.

For provider setup and the dedicated react-native-arc-ui/testing entrypoint, see Testing.

API Reference

Standalone Checkbox

Also inherits: Omit< PressableProps, "children" | "role" | "accessibilityRole" | "aria-checked" | "aria-disabled" >

PropTypeDefaultDescription
children?ReactNode—Optional Checkbox content. Text content receives ARCUI typography and accessibility handling. Custom React content is rendered as-is.
onCheckedChange?(checked: boolean) => void—Called when the checked state is requested to change. Standalone: the consumer owns checked and should update it when appropriate. SelectionGroup: optional child-level notification after the group resolves an actual state change. SelectionGroup remains the state owner.
animation?TPressAnimation—Press feedback behavior. Falls back to tokens.pressAnimation.type.
active?booleantrueWhether the Checkbox is active. Inactive keeps its dedicated visual state while preventing interaction.
size?number—Outer Checkbox box size. Falls back to tokens.sizings.checkbox.size.
error?string—Optional validation message. A non-empty value enables the Checkbox error visual state.
textStyle?StyleProp<TextStyle>—Style applied only to textual Checkbox content.
checkedbooleanrequiredStandalone semantic state. The consumer is the source of truth.

Grouped Checkbox

Also inherits: Omit< PressableProps, "children" | "role" | "accessibilityRole" | "aria-checked" | "aria-disabled" >

PropTypeDefaultDescription
children?ReactNode—Optional Checkbox content. Text content receives ARCUI typography and accessibility handling. Custom React content is rendered as-is.
onCheckedChange?(checked: boolean) => void—Called when the checked state is requested to change. Standalone: the consumer owns checked and should update it when appropriate. SelectionGroup: optional child-level notification after the group resolves an actual state change. SelectionGroup remains the state owner.
animation?TPressAnimation—Press feedback behavior. Falls back to tokens.pressAnimation.type.
active?booleantrueWhether the Checkbox is active. Inactive keeps its dedicated visual state while preventing interaction.
size?number—Outer Checkbox box size. Falls back to tokens.sizings.checkbox.size.
error?string—Optional validation message. A non-empty value enables the Checkbox error visual state.
textStyle?StyleProp<TextStyle>—Style applied only to textual Checkbox content.
valueTSelectionValuerequiredSelectionGroup identity. SelectionGroup owns the checked state.

Generated from the ARCUI 1.1.x TypeScript source snapshot. Native inherited props remain available through the referenced React Native surface.

The generated API shows the standalone and grouped discriminated variants. Checkbox also inherits supported native PressableProps except the semantic fields ARCUI owns directly.

Motion

Checkbox separates semantic selection from frame-level visuals.

ARCUI animates independent progress values for:

  • checked state;
  • disabled state;
  • inactive state;
  • validation state;
  • press feedback;
  • active theme interpolation.

Visual priority is explicit:

disabled
> inactive
> error
> pressed
> normal

Selection and modifier transitions use tokens.checkboxAnimations with global animation tokens as fallback. Press feedback uses tokens.pressAnimation. Error content uses ARCUI entering/exiting behavior.

See Motion for the broader ARCUI motion model.

Performance

Checkbox does not use React state as a frame-by-frame animation driver. Selection semantics remain controlled React/group state, while continuous color, scale, and checkmark transitions remain on the Reanimated path.

Text and error typography use ARCUI's central font-scale SharedValue without enabling native font scaling a second time.

See Performance.

Accessibility

Checkbox exposes native checkbox semantics and semantic state:

  • role: checkbox;
  • checked follows the real controlled/group state;
  • disabled accessibility state follows disabled || active === false;
  • textual children become the default accessible label;
  • validation content is exposed as a polite alert.

Consumer accessibilityLabel, accessibilityHint, and compatible inherited accessibility props remain available.

ARCUI does not inject a permanent generic gesture instruction. Use a hint only when it adds application-specific information beyond the native checkbox role and state.

See Accessibility.

Theming

Checkbox presentation is token-driven. Relevant areas include:

colors.light.checkbox
colors.dark.checkbox
colors.*.states.danger
sizings.checkbox
border.checkbox
radius.checkbox
typography.checkbox
checkboxAnimations
pressAnimation
animations
enteringExiting

Top-level token overrides are shallow. Compose a changed namespace from defaultTokens rather than relying on recursive merge behavior.

import { ARCUI, defaultTokens, type TTokensOverride } from "react-native-arc-ui";

const tokens = {
  radius: {
    ...defaultTokens.radius,
    checkbox: 6,
  },
  pressAnimation: {
    ...defaultTokens.pressAnimation,
    type: "scaleDown",
  },
} satisfies TTokensOverride;

export function App() {
  return <ARCUI tokens={tokens}>{/* application */}</ARCUI>;
}

See Tokens and Theming.

Try it live

Use the existing Snack to explore standalone/grouped ownership, states, sizing, and press feedback.

Open Checkbox in Expo Snack ↗

On this page