Skip to main content

Radio (Item)

caution

All props/parameters are optional unless they are marked with an asterisk ( * ).

Example​

import { components } from "replugged";
const { RadioItem } = components;

export function Settings(): React.ReactElement {
return (
<RadioItem
{...util.useSetting(cfg, "foo", "bar")}
options={[
{
name: "Option 1",
value: "option1",
},
{
name: "Option 2",
value: "option2",
},
]}>
Radio title
</RadioItem>
);
}

Enums​

EnumDescription
Radio.SizesRadio group sizes
NOT_SET | NONE | SMALL | MEDIUM

Props​

NameTypeDefaultDescription
classNamestringComponent class name
collapsibleClassNamestringRadio collapsible element class name
disabledbooleanfalseWhether the radio group is disabled
itemInfoClassNamestringRadio info element class name
itemTitleClassNamestringRadio title element class name
onChange* (option: RadioOptionType) => voidFunction ran on value change
options* RadioOptionType[]Array of radio options
orientationstringRadio orientation
radioItemClassNamestringRadio item element class name
radioPositionstringleftPosition of the radio
sizeRadio.SizesRadio.Sizes.MEDIUMDefine radio group size
valuestringSelected radio value
withTransparentBackgroundbooleanfalseWhether the radio group is transparent

Types​

RadioOptionType​

NameTypeDefaultDescription
collapsibleContentReactNodeOption collapsible elements
colorstringColor displayed on the side
descstringOption description
disabledbooleanfalseWhether the option is disabled
iconComponentType<unknown>Option icon
name* stringOption name
tooltipPositionTooltip.PositionsTooltip position displayed on the option
tooltipTextstringTooltip text displayed on the option
value* stringOption value