Radio Button
The Radio button component can be used to collect user input from a list of options.
Data
Property | Description | Expected Value |
|---|---|---|
| Label | Text to display as the label for the component. | String (e.g., Select an option). |
Options
Allows you to add options to the radio button field. You can click on Add new option button and add options manually or enable Dynamic options and enter the options using code.
Example Code for Dynamic Options
- Passing an array of objects and specifying each value:
{
{
[
{
label: "option1",
value: 1,
disable: false,
visible: true,
default: true,
},
{ label: "option2", value: 2, disable: false, visible: true },
{ label: "option3", value: 3, disable: false, visible: true },
];
}
}
- Passing an array of objects with a default value from a Table component's selected row:
{
{
queries.getEmployees.data.map((option) => ({
label: option.firstname,
value: option.firstname,
disable: false,
visible: true,
default: option.firstname === components.table1.selectedRow.firstname,
}));
}
}
Layout
Controls how the radio button options are arranged within the component.
Value | Description |
|---|---|
| Row | Options are arranged horizontally in a single row. |
| Column | Options are stacked vertically in a single column. |
| Wrap | Options are arranged horizontally and wrap to the next line when they exceed the available width. |