一键导入
groww-radio-button
Radio button component for single selection from mutually exclusive options. Use when user must choose exactly one option from a list.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Radio button component for single selection from mutually exclusive options. Use when user must choose exactly one option from a list.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | groww-radio-button |
| description | Radio button component for single selection from mutually exclusive options. Use when user must choose exactly one option from a list. |
import RadioButton from '@groww-tech/ui-toolkit/dist/esm/components/atoms/RadioButton';
import RadioButtonGroup from '@groww-tech/ui-toolkit/dist/esm/components/molecules/RadioButtonGroup';
// or
import { RadioButton, RadioButtonGroup } from '@groww-tech/ui-toolkit';
interface RadioButtonProps {
value: string; // Radio button value
isChecked: boolean; // Checked state
handleOnClick: (value: string, isChecked: boolean) => void;
label?: React.ReactNode; // Label text/element
size?: 'small' | 'medium' | 'large'; // Radio button size
isDisabled?: boolean; // Disabled state
radioButtonDirection?: 'left' | 'right'; // Label position
className?: string;
dataTestId?: string;
id?: string;
name?: string;
}
interface RadioButtonType {
value: string | number;
label: string;
isDisabled?: boolean;
}
interface RadioButtonGroupProps {
radioButtons: RadioButtonType[]; // Array of options
selected?: string | number; // Selected value
onSelect: (value: string | number) => void; // Selection handler
containerClassName?: string;
dataTestId?: string;
name?: string;
}
<RadioButton
value="option1"
isChecked={selected === 'option1'}
handleOnClick={(value) => setSelected(value)}
label="Option 1"
/>
const options = [
{ value: 'daily', label: 'Daily' },
{ value: 'weekly', label: 'Weekly' },
{ value: 'monthly', label: 'Monthly' },
];
<RadioButtonGroup
radioButtons={options}
selected={frequency}
onSelect={(value) => setFrequency(value)}
/>
const options = [
{ value: 'standard', label: 'Standard' },
{ value: 'premium', label: 'Premium' },
{ value: 'enterprise', label: 'Enterprise', isDisabled: true },
];
<RadioButtonGroup
radioButtons={options}
selected={plan}
onSelect={setPlan}
/>
<RadioButton
value="agree"
isChecked={isAgreed}
handleOnClick={(value) => setIsAgreed(true)}
label="I agree to the terms"
radioButtonDirection="right"
/>
Accordion component with collapsible sections. Use for FAQs, nested content, or expandable details sections.
Button component with variants, sizes, loading states, and icon support. Use when creating clickable actions, forms, or navigation buttons.
Calendar component for date and month selection. Use when building date pickers, scheduling interfaces, or date range selectors.
Carousel component for image/content sliders with navigation controls. Use for image galleries, hero sections, or content that scrolls horizontally.
Checkbox component for boolean or multi-select inputs. Use when building forms with boolean toggles or multiple selection lists.
Dropdown menu component with trigger and content pattern. Use when building selectable menus, action menus, or nested navigation.