Documentation
Form Components
Radio Group

Radio Group

The RadioGroup component is designed to manage a set of radio buttons that allows users to select a single option from multiple choices. It groups multiple Radio components together, ensuring that only one option can be selected at a time.

Installation

Install the package

npm i @start-base/react-form-elements

Add the styles

To use the React form elements styles in a Next.js project, import the styles in your layout.tsx file.

app/layout.tsx
import "@start-base/react-form-elements/styles.css";

Import the component

import RadioGroup from '@start-base/react-form-elements/RadioGroup';

Usages

Radio Group Component Disabled

Radio Group Component Error

API

A group of radio inputs managed together.

NameTypeDefaultDescription
namestringName of the input
labelstringnullLabel of the input
valuestring or numberValue of the input
onChangefunctionCallback function that is fired when the value changes.
inputClassNamestringnullClassname for input element
labelClassNamestringnullClassname for label element
errorClassNamestringnullClassname for error element
disabledbooleanfalseDisable the input
errorstring or boolean or objectnullError message to display below the input. if value is a boolean input border will be change. Also you can pass schema validator error objects.
optionsarray[]Array of options to display
optionLabelClassNamestringnullClassname for option label

Styling