Skip to main content

NeoPopRadio

A NeoPop-styled radio button with an optional label, configurable colors, and haptic feedback.

Usage

// dark mode example
import { NeoPopRadio } from 'neopop-rn';
import { useState } from 'react';

function Example() {
const [selected, setSelected] = useState(false);

return (
<NeoPopRadio
isChecked={selected}
onValueChange={setSelected}
label="Option A"
mode="dark"
colorMode="dark"
value="option_a"
name="payment_method"
/>
);
}
// light mode example
import { NeoPopRadio } from 'neopop-rn';
import { useState } from 'react';

function Example() {
const [selected, setSelected] = useState(false);

return (
<NeoPopRadio
isChecked={selected}
onValueChange={setSelected}
label="Option B"
mode="light"
colorMode="light"
colorConfig={{
checkedBorderColor: '#0d0d0d',
checkedFillColor: '#ffffff',
uncheckedBorderColor: '#cccccc',
uncheckedFillColor: '#ffffff',
dotColor: '#0d0d0d',
}}
/>
);
}

Props

PropTypeDefaultDescription
isCheckedbooleanRequired. Whether this radio option is selected.
onValueChange(value: boolean) => voidRequired. Called when the radio is tapped.
idstringHTML-like identifier for the radio input (accessibility).
namestringGroup name for the radio set (accessibility).
valuestringValue string associated with this option.
mode'dark' | 'light' | 'custom'Selects a built-in color preset; 'custom' defers entirely to colorConfig.
colorConfigNeoPopRadioColorConfigPer-token color overrides (see colorConfig table).
labelstringOptional text label displayed beside the radio button.
sizenumberDiameter of the radio circle in logical pixels.
disabledbooleanDisables interaction.
enableHapticsbooleanFires a haptic on selection.
colorMode'dark' | 'light'Theme mode used for global defaults.
styleStyleProp<ViewStyle>Additional style applied to the outer row container.
labelStyleStyleProp<TextStyle>Additional style applied to the label text.

colorConfig

KeyDescription
checkedBorderColorBorder color of the radio circle when selected.
checkedFillColorBackground fill of the circle when selected.
uncheckedBorderColorBorder color when unselected.
uncheckedFillColorBackground fill when unselected.
dotColorColor of the inner dot shown in the selected state.

Notes

  • Managing radio group state (mutually exclusive selection) is the responsibility of the consumer; NeoPopRadio is a single controlled input.
  • In 'custom' mode all colors must be supplied via colorConfig; no built-in defaults are applied.
  • size sets both width and height, keeping the circle uniform.