• CMSnpm version

    • Overview
    • ContentBuilder
    • InviteUserForm
    • LoginForm
    • RenewPasswordForm
    • WysiwygInput
  • UInpm version

    • Overview
    • Accordion
    • AlertBubble
    • AnnouncementBar
    • Avatar
    • AvatarFileInput
    • Badge
    • Button
    • ButtonGroup
    • ButtonList
    • Calendar
    • Checkbox
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • Chip
    • ColorRadio
    • ColorRadioGroup
    • Combobox
    • DatePicker
    • DatePickerInput
    • DateRangePicker
    • DateRangePickerInput
    • DatetimePicker
    • DatetimePickerInput
    • Dialog
    • Dropdown
    • Dropzone
    • ErrorMessage
    • FileInput
    • FlashMessages
    • FormComponent
    • Icon
    • IconButton
    • ImageGallery
    • InfoBox
    • Input
    • Label
    • Layout
    • Lightbox
    • ListItem
    • Loader
    • Lozenge
    • Menu
    • Message
    • Modal
    • ✅ ModalDialog
    • ✅ ModalHeader
    • MultiCombobox
    • MultiSelect
    • Pagination
    • Paper
    • Popover
    • Radio
    • RadioGroup
    • RasterImage
    • Select
    • Switch
    • ✅ Tabs
    • TextInput
    • TextLink
    • Textarea
    • TimePicker
    • TimePickerInput
    • Toggle
    • Tooltip
    • Typography
  • Formnpm version

    • Overview
    • AvatarFileInput
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • ColorRadioGroup
    • Combobox
    • DatePickerInput
    • DateRangePickerInput
    • DatetimePickerInput
    • Dropzone
    • FileInput
    • Form
    • FormRenderer
    • GpsInput
    • MoneyInput
    • MultiCombobox
    • MultiSelect
    • NumberInput
    • PasswordInput
    • RadioGroup
    • Select
    • TextInput
    • Textarea
    • TimePickerInput
    • Toggle
  • DataGridnpm version

    • Overview
    • DataGrid
    • DataGridCustomExample
    • ExportButton
    • FilterList
    • Filters
    • FiltersButton
    • FulltextInput
    • HiddenColumns
    • HiddenColumnsButton
    • Pagination
    • RowCounts
    • RowsPerPageSelect
    • SelectedRowsToolbar
    • TableV2
    • ToolbarControl
    • ToolbarCustoms
    • ToolbarTabs
  • Wysiwygnpm version

    • Overview
  • Resizernpm version

    • Overview
  • Routernpm version

    • Overview
  • Corenpm version

    • Overview
  • Core-Reactnpm version

    • Overview
  • DnDnpm version

    • Overview
  • Stylesnpm version

    • Overview
  • Localizenpm version

    • Overview
  • Analyticsnpm version

    • Overview
  • Datepickernpm version

    • Overview
  • Icons-generatornpm version

    • Overview
  • Smart-addressnpm version

    • Overview
  • E2Enpm version

    • Overview
  • E2E-Playwrightnpm version

    • Overview
View source on GitLab

RadioGroup

A labelled group of mutually exclusive radio options bound to a single value. Built on Base UI's RadioGroup and Radio.Root; renders a label, the options (each an inner Radio), and optional helper/error text.

When to use

Use @uxf/ui/radio-group for a controlled radio group outside a form, where you own value and onChange.

Use @uxf/form/radio-group inside a @uxf/form form — that twin wires react-hook-form (useController), consumes the form context (disabled/read-only, required validation), and derives its value from the field.

Usage

import { RadioGroup } from "@uxf/ui/radio-group";
import { useState } from "react";

const options = [
    { id: "1", label: "Radio one" },
    { id: "2", label: "Radio two" },
    { id: "3", label: "Radio three" },
];

function Example() {
    const [value, setValue] = useState<string | number | null>("1");

    return (
        <RadioGroup
            id="radiogroup"
            label="Choose one"
            name="choice"
            onChange={setValue}
            options={options}
            value={value}
        />
    );
}

Props

Extends FormControlProps<ValueId | null> (from @uxf/ui/types). ValueId is RadioGroupOptionValueId (string | number).

PropTypeDefaultDescription
labelReactNode— (required)Group label.
namestring— (required)Field name.
optionsRadioGroupOption[]— (required)Options to render.
valueValueId | null— (required)Id of the selected option.
onChange(value: ValueId | null) => void— (required)Called with the selected option id.
variantRadioGroupVariant"list"Layout variant.
radioSizeRadioSize"default"Size of the radio indicators.
helperTextReactNode—Text shown below the options; styled as an error when isInvalid.
hiddenLabelbooleanfalseVisually hide the label (kept for accessibility).
idstring—Root id; also used to build the error-message id.
forceColumnbooleanfalseDeclared on the props type but not applied by the current UI implementation.
classNamestring—Extra class on the root element.
styleCSSProperties—Inline style on the root element.
isDisabledbooleanfalseDisables the group and all options.
isInvalidbooleanfalseError styling on the group and helper text.
isReadOnlybooleanfalseAdds the read-only state class.
isRequiredbooleanfalseMarks the label as required.

The inherited isFocused, onFocus, and onBlur are part of the shared FormControlProps shape but are not wired by this UI component; they are consumed by the @uxf/form twin.

RadioGroupOption — one entry of options:

FieldTypeDescription
idstring | numberOption value.
labelReactNodeOption label.
disabledbooleanDisable this single option.

Variants & states

From theme.ts:

GroupValues
variantlist, column, row, radioButton

RadioGroupVariants is an open interface, so a project can add values via module augmentation:

declare module "@uxf/ui/radio-group/theme" {
    interface RadioGroupVariants {
        grid: true;
    }
}

radioSize accepts the Radio sizes (default, lg). Individual options can be disabled via option.disabled; the whole group via isDisabled.

Requirements

Import the stylesheets once in your global CSS:

@import url("@uxf/ui/css/radio.css");
@import url("@uxf/ui/css/radio-group.css");

form-component.css provides the helper/error text styling (.uxf-helper-text); import it if you use helperText or validation:

@import url("@uxf/ui/css/form-component.css");

Also requires the global @uxf/ui token layer, set up once per app — see @uxf/ui setup.

Default
Open in new tab
OnlyForE2ETests
Open in new tab
States
Open in new tab