Skip to main content

Radio

Radio allows the user to select one option from a set. Use RadioGroup to manage a group of Radio buttons with a shared selection state.

Import

import { Radio, RadioGroup } from '@ui-kitten/components';

Basic Usage

import React, { useState } from 'react';
import { Layout, Radio, RadioGroup } from '@ui-kitten/components';

const RadioExample = () => {
const [selectedIndex, setSelectedIndex] = useState(0);

return (
<Layout style={{ flex: 1, padding: 16 }}>
<RadioGroup
selectedIndex={selectedIndex}
onChange={(index) => setSelectedIndex(index)}
>
<Radio>Option 1</Radio>
<Radio>Option 2</Radio>
<Radio>Option 3</Radio>
</RadioGroup>
</Layout>
);
};

Props

Radio

PropertyTypeDefaultDescription
checkedbooleanfalseWhether the radio is selected.
onChange(checked: boolean) => void-Called when the radio value changes.
status'basic' | 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'control''basic'Semantic color of the radio.
childrenReactText | (props) => ReactElementundefinedLabel text or render function displayed next to the radio.

RadioGroup

PropertyTypeDefaultDescription
selectedIndexnumberundefinedIndex of the currently selected radio.
onChange(index: number) => void-Called when the selected radio changes.
childrenRadio[]-Radio elements.

Storybook

Live examples coming soon via Storybook.