Files
WRNexusJS/examples/component-showcase/app/pages/components/radio.wrn
T
2026-07-29 12:51:10 +05:30

501 lines
40 KiB
Plaintext

// 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 {
<nav class="docs-breadcrumbs" aria-label="Breadcrumb">
<a href="/">Components</a><span aria-hidden="true">/</span><a href="/forms">Forms</a><span aria-hidden="true">/</span><span>Radio</span>
</nav>
<header class="detail-hero">
<div class="detail-hero-copy">
<span class="showcase-eyebrow">Forms component</span>
<h1>Radio</h1>
<p>Theme-aware, responsive radio component.</p>
<div class="detail-badges"><span>25 props</span><span>0 slots</span><span>5 events</span><span>Theme ready</span><span>Responsive</span></div>
</div>
<div class="detail-hero-icon"><span class="icon-[lucide--component] size-10" aria-hidden="true"></span></div>
</header>
<section id="playground" class="detail-section playground-section" data-playground data-playground-component="Radio" data-playground-public-tag="true" data-playground-has-slot="false">
<div class="detail-section-heading"><span>Interactive playground</span><h2>Configure Radio</h2><p>Change any prop and inspect the server-rendered component immediately.</p></div>
<div class="playground-workbench">
<div class="playground-preview">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="playground-preview-source" data-playground-preview><div data-component="Radio" size="{playground_size}" color="{playground_color}" id="{playground_id}" name="{playground_name}" label="{playground_label}" hiddenLabel="{playground_hiddenLabel}" placeholder="{playground_placeholder}" variant="{playground_variant}" icon="{playground_icon}" iconPosition="{playground_iconPosition}" value="{playground_value}" options="{playground_options}" checked="{playground_checked}" orientation="{playground_orientation}" card="{playground_card}" rightAligned="{playground_rightAligned}" list="{playground_list}" helperText="{playground_helperText}" cornerHint="{playground_cornerHint}" error="{playground_error}" inline="{playground_inline}" readonly="{playground_readonly}" disabled="{playground_disabled}" required="{playground_required}" class="{playground_class}"></div></div>
<section class="playground-code" aria-label="Current component code">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component code</span><button type="button" data-playground-copy><span class="icon-[lucide--copy] size-4" aria-hidden="true"></span>Copy</button></header>
<pre><code data-playground-code>&lt;Radio
id="radio-1"
name="radioField"
label="Standard plan"
placeholder="Enter radio"
value="standard"
options='[]'
checked="true"
/&gt;</code></pre>
</section>
<div class="playground-status" data-playground-status aria-live="polite"></div>
</div>
<form class="playground-controls" data-playground-form>
<header><div><span>Component props</span><strong>25 controls</strong></div><button type="reset"><span class="icon-[lucide--rotate-ccw] size-4" aria-hidden="true"></span>Reset</button></header>
<div class="playground-fields"><label class="playground-field" for="playground-radio-size"><span><strong>size</strong><small>string</small></span><select id="playground-radio-size" name="pg_size"><option value="default" selected>default</option><option value="xs">xs</option><option value="sm">sm</option><option value="md">md</option><option value="lg">lg</option><option value="xl">xl</option><option value="icon">icon</option><option value="icon-xs">icon-xs</option><option value="icon-sm">icon-sm</option><option value="icon-lg">icon-lg</option></select></label><label class="playground-field" for="playground-radio-color"><span><strong>color</strong><small>string</small></span><select id="playground-radio-color" name="pg_color"><option value="primary" selected>primary</option><option value="secondary">secondary</option><option value="success">success</option><option value="warning">warning</option><option value="danger">danger</option><option value="info">info</option></select></label><label class="playground-field" for="playground-radio-id"><span><strong>id</strong><small>string</small></span><input id="playground-radio-id" name="pg_id" type="text" value="radio-1" /></label><label class="playground-field" for="playground-radio-name"><span><strong>name</strong><small>string</small></span><input id="playground-radio-name" name="pg_name" type="text" value="radioField" /></label><label class="playground-field" for="playground-radio-label"><span><strong>label</strong><small>string</small></span><input id="playground-radio-label" name="pg_label" type="text" value="Standard plan" /></label><label class="playground-toggle" for="playground-radio-hiddenLabel"><span><strong>hidden Label</strong><small>boolean</small></span><input id="playground-radio-hiddenLabel" name="pg_hiddenLabel" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-field" for="playground-radio-placeholder"><span><strong>placeholder</strong><small>string</small></span><input id="playground-radio-placeholder" name="pg_placeholder" type="text" value="Enter radio" /></label><label class="playground-field" for="playground-radio-variant"><span><strong>variant</strong><small>string</small></span><select id="playground-radio-variant" name="pg_variant"><option value="normal" selected>normal</option><option value="default">default</option><option value="outline">outline</option><option value="secondary">secondary</option><option value="ghost">ghost</option><option value="destructive">destructive</option><option value="link">link</option></select></label><label class="playground-field" for="playground-radio-icon"><span><strong>icon</strong><small>string</small></span><input id="playground-radio-icon" name="pg_icon" type="text" value="" /></label><label class="playground-field" for="playground-radio-iconPosition"><span><strong>icon Position</strong><small>string</small></span><select id="playground-radio-iconPosition" name="pg_iconPosition"><option value="start" selected>start</option><option value="end">end</option></select></label><label class="playground-field" for="playground-radio-value"><span><strong>value</strong><small>string</small></span><input id="playground-radio-value" name="pg_value" type="text" value="standard" /></label><label class="playground-field" for="playground-radio-options"><span><strong>options</strong><small>string</small></span><textarea id="playground-radio-options" name="pg_options" rows="5" spellcheck="false" data-playground-json>[]</textarea><em data-playground-error></em></label><label class="playground-toggle" for="playground-radio-checked"><span><strong>checked</strong><small>boolean</small></span><input id="playground-radio-checked" name="pg_checked" type="checkbox" value="true" checked data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-field" for="playground-radio-orientation"><span><strong>orientation</strong><small>string</small></span><select id="playground-radio-orientation" name="pg_orientation"><option value="vertical" selected>vertical</option><option value="horizontal">horizontal</option></select></label><label class="playground-toggle" for="playground-radio-card"><span><strong>card</strong><small>boolean</small></span><input id="playground-radio-card" name="pg_card" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-radio-rightAligned"><span><strong>right Aligned</strong><small>boolean</small></span><input id="playground-radio-rightAligned" name="pg_rightAligned" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-radio-list"><span><strong>list</strong><small>boolean</small></span><input id="playground-radio-list" name="pg_list" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-field" for="playground-radio-helperText"><span><strong>helper Text</strong><small>string</small></span><input id="playground-radio-helperText" name="pg_helperText" type="text" value="" /></label><label class="playground-field" for="playground-radio-cornerHint"><span><strong>corner Hint</strong><small>string</small></span><input id="playground-radio-cornerHint" name="pg_cornerHint" type="text" value="" /></label><label class="playground-field" for="playground-radio-error"><span><strong>error</strong><small>string</small></span><input id="playground-radio-error" name="pg_error" type="text" value="" /></label><label class="playground-toggle" for="playground-radio-inline"><span><strong>inline</strong><small>boolean</small></span><input id="playground-radio-inline" name="pg_inline" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-radio-readonly"><span><strong>readonly</strong><small>boolean</small></span><input id="playground-radio-readonly" name="pg_readonly" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-radio-disabled"><span><strong>disabled</strong><small>boolean</small></span><input id="playground-radio-disabled" name="pg_disabled" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-radio-required"><span><strong>required</strong><small>boolean</small></span><input id="playground-radio-required" name="pg_required" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-field" for="playground-radio-class"><span><strong>class</strong><small>string</small></span><input id="playground-radio-class" name="pg_class" type="text" value="" /></label></div>
</form>
</div>
</section>
<div class="detail-layout">
<main class="detail-content">
<section class="detail-section"><div class="detail-section-heading"><span>Live examples</span><h2>Designed for real product surfaces</h2><p>Compare configurations and resize the browser to check responsive behavior.</p></div><div class="demo-list">
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Basic usage</span><h2>Default radio</h2><p>Use a single radio control for one selectable option.</p></div>
<span class="demo-case-number">01</span>
</header>
<div class="demo-workbench">
<div id="radio-demo-1" class="demo-canvas demo-canvas--1">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Radio" size="default" color="primary" id="radio-1" name="radioField" label="Standard plan" placeholder="Enter radio" variant="normal" icon="" iconPosition="start" value="standard" options="[]" checked="true" orientation="vertical" card="false" rightAligned="false" list="false" helperText="" cornerHint="" error="" inline="false" readonly="false" disabled="false" required="false"></div></div>
</div>
<section class="demo-code" aria-label="Default radio usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Radio
id="radio-1"
name="radioField"
label="Standard plan"
placeholder="Enter radio"
value="standard"
options='[]'
checked="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">States</span><h2>Disabled</h2><p>Disable an option when it is unavailable.</p></div>
<span class="demo-case-number">02</span>
</header>
<div class="demo-workbench">
<div id="radio-demo-2" class="demo-canvas demo-canvas--2">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Radio" size="default" color="primary" id="radio-2" name="radioField" label="Choose a plan" placeholder="Enter radio" variant="outlined" icon="icon-[lucide--sparkles]" iconPosition="start" value="" options="[]" checked="false" orientation="vertical" card="false" rightAligned="false" list="false" helperText="" cornerHint="" error="" inline="false" readonly="false" disabled="true" required="false"></div></div>
</div>
<section class="demo-code" aria-label="Disabled usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Radio
id="radio-2"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
variant="outlined"
icon="icon-[lucide--sparkles]"
options='[]'
disabled="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Groups</span><h2>Inline radio group</h2><p>Arrange compact radio options on one horizontal line.</p></div>
<span class="demo-case-number">03</span>
</header>
<div class="demo-workbench">
<div id="radio-demo-3" class="demo-canvas demo-canvas--3">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Radio" size="default" color="primary" id="radio-3" name="radioField" label="Choose a plan" placeholder="Enter radio" variant="floating" icon="icon-[lucide--circle-user-round]" iconPosition="end" value="" options="[{&quot;label&quot;:&quot;Starter&quot;,&quot;value&quot;:&quot;starter&quot;,&quot;description&quot;:&quot;&quot;},{&quot;label&quot;:&quot;Professional&quot;,&quot;value&quot;:&quot;professional&quot;,&quot;description&quot;:&quot;&quot;},{&quot;label&quot;:&quot;Enterprise&quot;,&quot;value&quot;:&quot;enterprise&quot;,&quot;description&quot;:&quot;&quot;}]" checked="false" orientation="horizontal" card="false" rightAligned="false" list="false" helperText="" cornerHint="" error="" inline="false" readonly="false" disabled="false" required="false"></div></div>
</div>
<section class="demo-code" aria-label="Inline radio group usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Radio
id="radio-3"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
variant="floating"
icon="icon-[lucide--circle-user-round]"
iconPosition="end"
options='[
&#123;
"label": "Starter",
"value": "starter",
"description": ""
&#125;,
&#123;
"label": "Professional",
"value": "professional",
"description": ""
&#125;,
&#123;
"label": "Enterprise",
"value": "enterprise",
"description": ""
&#125;
]'
orientation="horizontal"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Groups</span><h2>Vertical radio group</h2><p>Stack radio options for easy scanning.</p></div>
<span class="demo-case-number">04</span>
</header>
<div class="demo-workbench">
<div id="radio-demo-4" class="demo-canvas demo-canvas--4">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Radio" size="sm" color="primary" id="radio-4" name="radioField" label="Choose a plan" placeholder="Enter radio" variant="pill" icon="" iconPosition="start" value="" options="[{&quot;label&quot;:&quot;Starter&quot;,&quot;value&quot;:&quot;starter&quot;,&quot;description&quot;:&quot;&quot;},{&quot;label&quot;:&quot;Professional&quot;,&quot;value&quot;:&quot;professional&quot;,&quot;description&quot;:&quot;&quot;},{&quot;label&quot;:&quot;Enterprise&quot;,&quot;value&quot;:&quot;enterprise&quot;,&quot;description&quot;:&quot;&quot;}]" checked="false" orientation="vertical" card="false" rightAligned="false" list="false" helperText="" cornerHint="" error="" inline="false" readonly="false" disabled="false" required="false"></div></div>
</div>
<section class="demo-code" aria-label="Vertical radio group usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Radio
size="sm"
id="radio-4"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
variant="pill"
options='[
&#123;
"label": "Starter",
"value": "starter",
"description": ""
&#125;,
&#123;
"label": "Professional",
"value": "professional",
"description": ""
&#125;,
&#123;
"label": "Enterprise",
"value": "enterprise",
"description": ""
&#125;
]'
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Content</span><h2>Radios with descriptions</h2><p>Add supporting copy to clarify each choice.</p></div>
<span class="demo-case-number">05</span>
</header>
<div class="demo-workbench">
<div id="radio-demo-5" class="demo-canvas demo-canvas--5">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Radio" size="default" color="primary" id="radio-5" name="radioField" label="Choose a plan" placeholder="Enter radio" variant="normal" icon="" iconPosition="start" value="" options="[{&quot;label&quot;:&quot;Starter&quot;,&quot;value&quot;:&quot;starter&quot;,&quot;description&quot;:&quot;For individuals and small projects.&quot;},{&quot;label&quot;:&quot;Professional&quot;,&quot;value&quot;:&quot;professional&quot;,&quot;description&quot;:&quot;For growing teams and products.&quot;},{&quot;label&quot;:&quot;Enterprise&quot;,&quot;value&quot;:&quot;enterprise&quot;,&quot;description&quot;:&quot;For organizations needing advanced controls.&quot;}]" checked="false" orientation="vertical" card="false" rightAligned="false" list="false" helperText="" cornerHint="" error="" inline="false" readonly="true" disabled="false" required="false"></div></div>
</div>
<section class="demo-code" aria-label="Radios with descriptions usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Radio
id="radio-5"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
options='[
&#123;
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
&#125;,
&#123;
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
&#125;,
&#123;
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
&#125;
]'
readonly="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Cards</span><h2>Radio cards</h2><p>Present options as selectable horizontal cards.</p></div>
<span class="demo-case-number">06</span>
</header>
<div class="demo-workbench">
<div id="radio-demo-6" class="demo-canvas demo-canvas--6">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Radio" size="default" color="primary" id="radio-6" name="radioField" label="Choose a plan" placeholder="Enter radio" variant="normal" icon="" iconPosition="start" value="" options="[{&quot;label&quot;:&quot;Starter&quot;,&quot;value&quot;:&quot;starter&quot;,&quot;description&quot;:&quot;For individuals and small projects.&quot;},{&quot;label&quot;:&quot;Professional&quot;,&quot;value&quot;:&quot;professional&quot;,&quot;description&quot;:&quot;For growing teams and products.&quot;},{&quot;label&quot;:&quot;Enterprise&quot;,&quot;value&quot;:&quot;enterprise&quot;,&quot;description&quot;:&quot;For organizations needing advanced controls.&quot;}]" checked="false" orientation="horizontal" card="true" rightAligned="false" list="false" helperText="" cornerHint="" error="" inline="false" readonly="false" disabled="false" required="false"></div></div>
</div>
<section class="demo-code" aria-label="Radio cards usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Radio
id="radio-6"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
options='[
&#123;
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
&#125;,
&#123;
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
&#125;,
&#123;
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
&#125;
]'
orientation="horizontal"
card="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Cards</span><h2>Vertical radio cards</h2><p>Stack selectable cards in a vertical layout.</p></div>
<span class="demo-case-number">07</span>
</header>
<div class="demo-workbench">
<div id="radio-demo-7" class="demo-canvas demo-canvas--7">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Radio" size="default" color="primary" id="radio-7" name="radioField" label="Choose a plan" placeholder="Enter radio" variant="normal" icon="" iconPosition="start" value="" options="[{&quot;label&quot;:&quot;Starter&quot;,&quot;value&quot;:&quot;starter&quot;,&quot;description&quot;:&quot;For individuals and small projects.&quot;},{&quot;label&quot;:&quot;Professional&quot;,&quot;value&quot;:&quot;professional&quot;,&quot;description&quot;:&quot;For growing teams and products.&quot;},{&quot;label&quot;:&quot;Enterprise&quot;,&quot;value&quot;:&quot;enterprise&quot;,&quot;description&quot;:&quot;For organizations needing advanced controls.&quot;}]" checked="false" orientation="vertical" card="true" rightAligned="false" list="false" helperText="" cornerHint="" error="" inline="true" readonly="false" disabled="false" required="false"></div></div>
</div>
<section class="demo-code" aria-label="Vertical radio cards usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Radio
id="radio-7"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
options='[
&#123;
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
&#125;,
&#123;
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
&#125;,
&#123;
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
&#125;
]'
card="true"
inline="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Alignment</span><h2>Right-aligned radio</h2><p>Place controls at the far edge of their labels.</p></div>
<span class="demo-case-number">08</span>
</header>
<div class="demo-workbench">
<div id="radio-demo-8" class="demo-canvas demo-canvas--8">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Radio" size="default" color="primary" id="radio-8" name="radioField" label="Choose a plan" placeholder="Enter radio" variant="normal" icon="" iconPosition="start" value="" options="[{&quot;label&quot;:&quot;Starter&quot;,&quot;value&quot;:&quot;starter&quot;,&quot;description&quot;:&quot;For individuals and small projects.&quot;},{&quot;label&quot;:&quot;Professional&quot;,&quot;value&quot;:&quot;professional&quot;,&quot;description&quot;:&quot;For growing teams and products.&quot;},{&quot;label&quot;:&quot;Enterprise&quot;,&quot;value&quot;:&quot;enterprise&quot;,&quot;description&quot;:&quot;For organizations needing advanced controls.&quot;}]" checked="false" orientation="vertical" card="false" rightAligned="true" list="false" helperText="" cornerHint="Optional" error="" inline="false" readonly="false" disabled="false" required="false"></div></div>
</div>
<section class="demo-code" aria-label="Right-aligned radio usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Radio
id="radio-8"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
options='[
&#123;
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
&#125;,
&#123;
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
&#125;,
&#123;
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
&#125;
]'
rightAligned="true"
cornerHint="Optional"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Lists</span><h2>Radio list group</h2><p>Separate options with list dividers.</p></div>
<span class="demo-case-number">09</span>
</header>
<div class="demo-workbench">
<div id="radio-demo-9" class="demo-canvas demo-canvas--9">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Radio" size="default" color="primary" id="radio-9" name="radioField" label="Choose a plan" placeholder="Enter radio" variant="normal" icon="" iconPosition="start" value="" options="[{&quot;label&quot;:&quot;Starter&quot;,&quot;value&quot;:&quot;starter&quot;,&quot;description&quot;:&quot;For individuals and small projects.&quot;},{&quot;label&quot;:&quot;Professional&quot;,&quot;value&quot;:&quot;professional&quot;,&quot;description&quot;:&quot;For growing teams and products.&quot;},{&quot;label&quot;:&quot;Enterprise&quot;,&quot;value&quot;:&quot;enterprise&quot;,&quot;description&quot;:&quot;For organizations needing advanced controls.&quot;}]" checked="false" orientation="vertical" card="false" rightAligned="false" list="true" helperText="" cornerHint="" error="" inline="false" readonly="false" disabled="false" required="false"></div></div>
</div>
<section class="demo-code" aria-label="Radio list group usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Radio
id="radio-9"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
options='[
&#123;
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
&#125;,
&#123;
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
&#125;,
&#123;
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
&#125;
]'
list="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Lists</span><h2>Horizontal radio list group</h2><p>Combine list styling with a horizontal layout.</p></div>
<span class="demo-case-number">010</span>
</header>
<div class="demo-workbench">
<div id="radio-demo-10" class="demo-canvas demo-canvas--10">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><div data-component="Radio" size="default" color="primary" id="radio-10" name="radioField" label="Choose a plan" placeholder="Enter radio" variant="normal" icon="" iconPosition="start" value="" options="[{&quot;label&quot;:&quot;Starter&quot;,&quot;value&quot;:&quot;starter&quot;,&quot;description&quot;:&quot;For individuals and small projects.&quot;},{&quot;label&quot;:&quot;Professional&quot;,&quot;value&quot;:&quot;professional&quot;,&quot;description&quot;:&quot;For growing teams and products.&quot;},{&quot;label&quot;:&quot;Enterprise&quot;,&quot;value&quot;:&quot;enterprise&quot;,&quot;description&quot;:&quot;For organizations needing advanced controls.&quot;}]" checked="false" orientation="horizontal" card="false" rightAligned="false" list="true" helperText="" cornerHint="" error="" inline="false" readonly="false" disabled="false" required="false"></div></div>
</div>
<section class="demo-code" aria-label="Horizontal radio list group usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Radio
id="radio-10"
name="radioField"
label="Choose a plan"
placeholder="Enter radio"
options='[
&#123;
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
&#125;,
&#123;
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
&#125;,
&#123;
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
&#125;
]'
orientation="horizontal"
list="true"
/&gt;</code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Validation</span><h2>Validation states</h2><p>Validate the selected group with @wrnexus/validation.</p></div>
<span class="demo-case-number">011</span>
</header>
<div class="demo-workbench">
<div id="radio-demo-11" class="demo-canvas demo-canvas--11">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><form data-schema="basic-form-validation" class="demo-validation-form"><div data-component="Radio" size="default" color="primary" id="radio-11" name="validatedField" label="Choose a plan" placeholder="Enter radio" variant="normal" icon="" iconPosition="start" value="" options="[{&quot;label&quot;:&quot;Starter&quot;,&quot;value&quot;:&quot;starter&quot;,&quot;description&quot;:&quot;For individuals and small projects.&quot;},{&quot;label&quot;:&quot;Professional&quot;,&quot;value&quot;:&quot;professional&quot;,&quot;description&quot;:&quot;For growing teams and products.&quot;},{&quot;label&quot;:&quot;Enterprise&quot;,&quot;value&quot;:&quot;enterprise&quot;,&quot;description&quot;:&quot;For organizations needing advanced controls.&quot;}]" checked="false" orientation="vertical" card="false" rightAligned="false" list="false" helperText="Select one plan to continue." cornerHint="" error="" inline="false" readonly="false" disabled="false" required="true"></div><button type="submit" class="wire-btn wire-btn--variant-default">Validate selection</button></form></div>
</div>
<section class="demo-code" aria-label="Validation states usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>&lt;Radio
id="radio-11"
name="validatedField"
label="Choose a plan"
placeholder="Enter radio"
options='[
&#123;
"label": "Starter",
"value": "starter",
"description": "For individuals and small projects."
&#125;,
&#123;
"label": "Professional",
"value": "professional",
"description": "For growing teams and products."
&#125;,
&#123;
"label": "Enterprise",
"value": "enterprise",
"description": "For organizations needing advanced controls."
&#125;
]'
helperText="Select one plan to continue."
required="true"
/&gt;</code></pre>
</section>
</div>
</article></div></section>
<section id="events" class="detail-section"><div class="detail-section-heading"><span>Component events</span><h2>Events</h2><p>Public events declared by this component. Custom events bubble from the component root and expose state through <code>event.detail</code>.</p></div><div class="detail-events-grid"><div class="detail-events-list"><div><code>@input</code><span>Fires immediately as the component value changes.</span></div><div><code>@change</code><span>Fires when the component value or selection changes.</span></div><div><code>@focus</code><span>Fires when the component receives focus.</span></div><div><code>@blur</code><span>Fires when focus leaves the component.</span></div><div><code>@invalid</code><span>Fires when the component emits the invalid event.</span></div></div><section class="demo-code"><header><span><span class="icon-[lucide--radio] size-4" aria-hidden="true"></span>Event listener</span><small>.js</small></header><pre><code>const component = document.querySelector('[data-wrn-events]')
component.addEventListener('input', (event) =&gt; &#123;
console.log(event.detail)
&#125;)</code></pre></section></div></section>
<section id="api" class="detail-section"><div class="detail-section-heading"><span>Component API</span><h2>Props and configuration</h2><p>All content and behavior shown above is supplied through these props and slots.</p></div><div class="docs-table-wrap"><table class="docs-table"><thead><tr><th>Prop</th><th>Type</th><th>Default</th><th>Required</th></tr></thead><tbody><tr><td><code>size</code></td><td>string</td><td><code>"default"</code></td><td>No</td></tr><tr><td><code>color</code></td><td>string</td><td><code>"primary"</code></td><td>No</td></tr><tr><td><code>id</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>name</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>label</code></td><td>string</td><td><code>"Radio"</code></td><td>No</td></tr><tr><td><code>hiddenLabel</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>placeholder</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>variant</code></td><td>string</td><td><code>"normal"</code></td><td>No</td></tr><tr><td><code>icon</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>iconPosition</code></td><td>string</td><td><code>"start"</code></td><td>No</td></tr><tr><td><code>value</code></td><td>string</td><td><code>"on"</code></td><td>No</td></tr><tr><td><code>options</code></td><td>string</td><td><code>[]</code></td><td>No</td></tr><tr><td><code>checked</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>orientation</code></td><td>string</td><td><code>"vertical"</code></td><td>No</td></tr><tr><td><code>card</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>rightAligned</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>list</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>helperText</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>cornerHint</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>error</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>inline</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>readonly</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>disabled</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>required</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>class</code></td><td>string</td><td><code>""</code></td><td>No</td></tr></tbody></table></div></section>
</main>
<aside class="detail-aside">
<div class="detail-toc"><strong>On this page</strong><a href="#playground">Playground</a><a href="#radio-demo-1">Default radio</a><a href="#radio-demo-2">Disabled</a><a href="#radio-demo-3">Inline radio group</a><a href="#radio-demo-4">Vertical radio group</a><a href="#radio-demo-5">Radios with descriptions</a><a href="#radio-demo-6">Radio cards</a><a href="#radio-demo-7">Vertical radio cards</a><a href="#radio-demo-8">Right-aligned radio</a><a href="#radio-demo-9">Radio list group</a><a href="#radio-demo-10">Horizontal radio list group</a><a href="#radio-demo-11">Validation states</a><a href="#events">Events</a><a href="#api">Props API</a></div>
</aside>
</div>
<nav class="detail-pagination">
<a href="/components/input-group"><small>Previous</small><strong>← Input Group</strong></a>
<a href="/components/range-slider"><small>Next</small><strong>Range Slider →</strong></a>
</nav>
}
}