Shared-name options
The checked, unchecked, and disabled appearances in one native mutually exclusive group.
name="shared-role" value="first" / value="second"
WelkUI!REACT EDITIONExplore live variants, compare states, and learn every prop. Pick a component to start.
A labeled native radio for one mutually exclusive option. Give related radios the same name and different values. Control checked/onChange individually or use WelkRadioGroup for a labeled options collection.
import { WelkRadio } from "@welkui/react";
<WelkRadio label="Hero" name="role" value="hero" />
<WelkRadio label="Sidekick" name="role" value="sidekick" />Import @welkui/react/styles.css once in your app. Stateful snippets belong inside a React component.
These are real components, not screenshots. Compare their appearance and try the controls. Key props below each preview show what changes; use the usage example above for imports and component setup.
The checked, unchecked, and disabled appearances in one native mutually exclusive group.
name="shared-role" value="first" / value="second"A selected radio can remain checked while disabled.
disabled defaultCheckedRequired props are marked in the default column. Other props are optional. ReactNode accepts text or JSX.
| Prop | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Required | Visible, accessible control label. |
checked | boolean | Uncontrolled | Controlled checked state; update it through the change callback. |
defaultChecked | boolean | false | Initial checked state for uncontrolled use. |
onChange | ChangeEventHandler<HTMLInputElement> | Unset | Native change event; read event.currentTarget.checked. |
name | string | Unset | Shared group name; required for native mutual exclusion. |
value | Native input value | Native default | Submitted value for this option. |
Inherits native input props except the fields replaced by this component's API: name, id, disabled, required, form, onBlur, onFocus, className, style, aria-* and data-* are supported. Forwards an input ref. type is fixed to radio; size and children are omitted.
Import @welkui/react/styles.css once in your app entry or Next.js root layout. The previews use the default theme; override --welk-* CSS tokens in your app to customize it.
For Next.js, put hooks and event handlers in a component beginning with "use client". Keep state local to the component using the control. The library preserves its client boundaries and uses your installed React version.
Use defaultValue or defaultChecked for uncontrolled fields, or a state value and its change callback for controlled fields. Do not switch between these modes during the lifetime of a field.
Modal and notification examples start closed: use their Try buttons to see them. Disabled examples are deliberately non-interactive. Validate forms, uploads, authentication, and server responses in your application; these components only provide UI.