Choose one value from a related set.
import { useState } from 'react';
import { RadioGroup } from '@vrum/ui';
import { RadioGroupItem } from '@vrum/ui';
export default function Demo() {
const [value, setValue] = useState("design");
return (
<RadioGroup
value={value}
aria-label={"Project discipline"}
onValueChange={setValue}
>
<label><RadioGroupItem value="design" /> Design</label>
<label><RadioGroupItem value="engineering" /> Engineering</label>
</RadioGroup>
);
}Copy code| Prop | Type | Default | Description |
|---|---|---|---|
name | string | none | name configuration. |
form | string | none | form configuration. |
required | boolean | none | required configuration. |
disabled | boolean | none | Disable user interaction. |
dir | Direction | none | dir configuration. |
orientation | Orientation | none | orientation configuration. |
loop | boolean | none | loop configuration. |
defaultValue | string | none | Initial value for an uncontrolled component. |
value | string | null | none | Controlled value; connect the callback to application state. |
onValueChange | ((value: string) => void) | none | Called when the selected value changes. |
asChild | boolean | none | as child configuration. |
defaultChecked | boolean | none | default checked configuration. |
autoFocus | boolean | none | auto focus configuration. |
className | string | none | Additional CSS classes. |
id | string | none | id configuration. |
style | CSSProperties | none | Inline style overrides. |
aria-invalid | boolean | "false" | "true" | "grammar" | "spelling" | none | Indicates the entered value does not conform to the format expected by the application. |
aria-label | string | none | aria-label configuration. |
children | ReactNode | none | Content rendered inside the component. |
onFocus | FocusEventHandler<HTMLDivElement> | none | on focus configuration. |
onBlur | FocusEventHandler<HTMLDivElement> | none | on blur configuration. |
onChange | ChangeEventHandler<HTMLDivElement, Element> | none | Called when the input value changes. |
onSubmit | SubmitEventHandler<HTMLDivElement> | none | Called when the form is submitted. |
onKeyDown | KeyboardEventHandler<HTMLDivElement> | none | on key down configuration. |
onClick | MouseEventHandler<HTMLDivElement> | none | Called when the control is activated. |
onSelect | ReactEventHandler<HTMLDivElement> | none | on select configuration. |
| Prop | Type | Default | Description |
|---|---|---|---|
value* | string | none | Controlled value. |
asChild | boolean | none | as child configuration. |
disabled | boolean | none | Disable user interaction. |
type | "submit" | "reset" | "button" | none | type configuration. |
defaultChecked | boolean | none | default checked configuration. |
defaultValue | string | number | readonly string[] | none | Initial value for an uncontrolled component. |
autoFocus | boolean | none | auto focus configuration. |
className | string | none | Additional CSS classes. |
id | string | none | id configuration. |
style | CSSProperties | none | Inline style overrides. |
aria-invalid | boolean | "false" | "true" | "grammar" | "spelling" | none | Indicates the entered value does not conform to the format expected by the application. |
aria-label | string | none | Defines a string value that labels the current element. |
children | ReactNode | none | Content rendered inside the component. |
onFocus | FocusEventHandler<HTMLButtonElement> | none | on focus configuration. |
onBlur | FocusEventHandler<HTMLButtonElement> | none | on blur configuration. |
onChange | ChangeEventHandler<HTMLButtonElement, Element> | none | Called when the input value changes. |
onSubmit | SubmitEventHandler<HTMLButtonElement> | none | Called when the form is submitted. |
onKeyDown | KeyboardEventHandler<HTMLButtonElement> | none | on key down configuration. |
onClick | MouseEventHandler<HTMLButtonElement> | none | Called when the control is activated. |
onSelect | ReactEventHandler<HTMLButtonElement> | none | on select configuration. |
checked | boolean | none | checked configuration. |
required | boolean | none | required configuration. |