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
isCheckedboolean—Required. Whether this radio option is selected.
onValueChange(value: boolean) => void—Required. Called when the radio is tapped.
idstring—HTML-like identifier for the radio input (accessibility).
namestring—Group name for the radio set (accessibility).
valuestring—Value string associated with this option.
mode'dark' | 'light' | 'custom'—Selects a built-in color preset; 'custom' defers entirely to colorConfig.
colorConfigNeoPopRadioColorConfig—Per-token color overrides (see colorConfig table).
labelstring—Optional text label displayed beside the radio button.
sizenumber—Diameter of the radio circle in logical pixels.
disabledboolean—Disables interaction.
enableHapticsboolean—Fires 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.