React RadioButton

React RadioButton

·

1 min read

React RadioButton is an extension to standard radio button element with theming.

Setup

Refer to PrimeReact setup documentation for download and installation steps for your environment.

Import

import { RadioButton } from 'primereact/radiobutton';

Getting Started

RadioButton is used as a controlled input with checked and onChange properties.

<RadioButton value="val1" name="city" onChange={(e) => setValue(e.value)} checked={value === 'val1'} />
<RadioButton value="val2" name="city" onChange={(e) => setValue(e.value)} checked={value === 'val2'} />

Theming

RadioButton supports various themes featuring Material, Bootstrap, Fluent as well as your own custom themes via the Designer tool.

Resources

Visit the PrimeReact RadioButton showcase for demos and documentation.

Setup

Refer to PrimeReact setup documentation for download and installation steps for your environment.