Default radio
Use a single radio control for one selectable option.
<Radio
id="radio-1"
name="radioField"
label="Standard plan"
placeholder="Enter radio"
value="standard"
options='[]'
checked="true"
/>
// Generated by scripts/generate-showcase.mjs. Do not edit directly.
page RadioDetail {
layout = "showcase"
state playground_size = ctx.url.searchParams.get("pg_size") ?? "default"
state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary"
state playground_id = ctx.url.searchParams.get("pg_id") ?? "radio-1"
state playground_name = ctx.url.searchParams.get("pg_name") ?? "radioField"
state playground_label = ctx.url.searchParams.get("pg_label") ?? "Standard plan"
state playground_hiddenLabel = ctx.url.searchParams.get("pg_hiddenLabel") ?? "false"
state playground_placeholder = ctx.url.searchParams.get("pg_placeholder") ?? "Enter radio"
state playground_variant = ctx.url.searchParams.get("pg_variant") ?? "normal"
state playground_icon = ctx.url.searchParams.get("pg_icon") ?? ""
state playground_iconPosition = ctx.url.searchParams.get("pg_iconPosition") ?? "start"
state playground_value = ctx.url.searchParams.get("pg_value") ?? "standard"
state playground_options = ctx.url.searchParams.get("pg_options") ?? "[]"
state playground_checked = ctx.url.searchParams.get("pg_checked") ?? "true"
state playground_orientation = ctx.url.searchParams.get("pg_orientation") ?? "vertical"
state playground_card = ctx.url.searchParams.get("pg_card") ?? "false"
state playground_rightAligned = ctx.url.searchParams.get("pg_rightAligned") ?? "false"
state playground_list = ctx.url.searchParams.get("pg_list") ?? "false"
state playground_helperText = ctx.url.searchParams.get("pg_helperText") ?? ""
state playground_cornerHint = ctx.url.searchParams.get("pg_cornerHint") ?? ""
state playground_error = ctx.url.searchParams.get("pg_error") ?? ""
state playground_inline = ctx.url.searchParams.get("pg_inline") ?? "false"
state playground_readonly = ctx.url.searchParams.get("pg_readonly") ?? "false"
state playground_disabled = ctx.url.searchParams.get("pg_disabled") ?? "false"
state playground_required = ctx.url.searchParams.get("pg_required") ?? "false"
state playground_class = ctx.url.searchParams.get("pg_class") ?? ""
seo {
title = "Radio"
description = "Theme-aware, responsive radio component."
}
view {
Theme-aware, responsive radio component. Change any prop and inspect the server-rendered component immediately.Radio
Configure Radio
<Radio
id="radio-1"
name="radioField"
label="Standard plan"
placeholder="Enter radio"
value="standard"
options='[]'
checked="true"
/>
Compare configurations and resize the browser to check responsive behavior.
Use a single radio control for one selectable option.
<Radio
id="radio-1"
name="radioField"
label="Standard plan"
placeholder="Enter radio"
value="standard"
options='[]'
checked="true"
/>
Disable an option when it is unavailable.
<Radio
id="radio-2"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
variant="outlined"
icon="icon-[lucide--sparkles]"
options='[]'
disabled="true"
/>
Arrange compact radio options on one horizontal line.
<Radio
id="radio-3"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
variant="floating"
icon="icon-[lucide--circle-user-round]"
iconPosition="end"
options='[
{
"label": "Starter",
"value": "starter",
"description": ""
},
{
"label": "Professional",
"value": "professional",
"description": ""
},
{
"label": "Enterprise",
"value": "enterprise",
"description": ""
}
]'
orientation="horizontal"
/>
Stack radio options for easy scanning.
<Radio
size="sm"
id="radio-4"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
variant="pill"
options='[
{
"label": "Starter",
"value": "starter",
"description": ""
},
{
"label": "Professional",
"value": "professional",
"description": ""
},
{
"label": "Enterprise",
"value": "enterprise",
"description": ""
}
]'
/>
Add supporting copy to clarify each choice.
<Radio
id="radio-5"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
options='[
{
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
},
{
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
},
{
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
}
]'
readonly="true"
/>
Present options as selectable horizontal cards.
<Radio
id="radio-6"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
options='[
{
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
},
{
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
},
{
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
}
]'
orientation="horizontal"
card="true"
/>
Stack selectable cards in a vertical layout.
<Radio
id="radio-7"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
options='[
{
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
},
{
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
},
{
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
}
]'
card="true"
inline="true"
/>
Place controls at the far edge of their labels.
<Radio
id="radio-8"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
options='[
{
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
},
{
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
},
{
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
}
]'
rightAligned="true"
cornerHint="Optional"
/>
Separate options with list dividers.
<Radio
id="radio-9"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
options='[
{
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
},
{
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
},
{
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
}
]'
list="true"
/>
Combine list styling with a horizontal layout.
<Radio
id="radio-10"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
options='[
{
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
},
{
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
},
{
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
}
]'
orientation="horizontal"
list="true"
/>
Validate the selected group with @wrnexus/validation.
<Radio
id="radio-11"
name="validatedField"
label="Choose a plan"
placeholder="Enter radio"
options='[
{
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
},
{
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
},
{
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
}
]'
helperText="Select one plan to continue."
required="true"
/>
Public events declared by this component. Custom events bubble from the component root and expose state through event.detail.
@inputFires immediately as the component value changes.@changeFires when the component value or selection changes.@focusFires when the component receives focus.@blurFires when focus leaves the component.@invalidFires when the component emits the invalid event.const component = document.querySelector('[data-wrn-events]')
component.addEventListener('input', (event) => {
console.log(event.detail)
})All content and behavior shown above is supplied through these props and slots.
| Prop | Type | Default | Required |
|---|---|---|---|
size | string | "default" | No |
color | string | "primary" | No |
id | string | "" | No |
name | string | "" | No |
label | string | "Radio" | No |
hiddenLabel | boolean | false | No |
placeholder | string | "" | No |
variant | string | "normal" | No |
icon | string | "" | No |
iconPosition | string | "start" | No |
value | string | "on" | No |
options | string | [] | No |
checked | boolean | false | No |
orientation | string | "vertical" | No |
card | boolean | false | No |
rightAligned | boolean | false | No |
list | boolean | false | No |
helperText | string | "" | No |
cornerHint | string | "" | No |
error | string | "" | No |
inline | boolean | false | No |
readonly | boolean | false | No |
disabled | boolean | false | No |
required | boolean | false | No |
class | string | "" | No |