// Generated by scripts/generate-showcase.mjs. Do not edit directly.
page TogglePasswordDetail {
  layout = "showcase"
  state playground_size = ctx.url.searchParams.get("pg_size") ?? "default"
  state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary"
  state playground_label = ctx.url.searchParams.get("pg_label") ?? "Password"
  state playground_name = ctx.url.searchParams.get("pg_name") ?? "toggle-password-1"
  state playground_value = ctx.url.searchParams.get("pg_value") ?? "Northstar!2026"
  state playground_placeholder = ctx.url.searchParams.get("pg_placeholder") ?? "Enter your password"
  state playground_autocomplete = ctx.url.searchParams.get("pg_autocomplete") ?? "current-password"
  state playground_minlength = ctx.url.searchParams.get("pg_minlength") ?? ""
  state playground_maxlength = ctx.url.searchParams.get("pg_maxlength") ?? "128"
  state playground_pattern = ctx.url.searchParams.get("pg_pattern") ?? "(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}"
  state playground_fields = JSON.parse(ctx.url.searchParams.get("pg_fields") ?? "[]")
  state playground_visible = (ctx.url.searchParams.get("pg_visible") ?? "false") === "true"
  state playground_toggleable = (ctx.url.searchParams.get("pg_toggleable") ?? "true") === "true"
  state playground_toggleMode = ctx.url.searchParams.get("pg_toggleMode") ?? "button"
  state playground_checkboxLabel = ctx.url.searchParams.get("pg_checkboxLabel") ?? "Show password"
  state playground_showLabel = ctx.url.searchParams.get("pg_showLabel") ?? "Show password"
  state playground_hideLabel = ctx.url.searchParams.get("pg_hideLabel") ?? "Hide password"
  state playground_disabled = (ctx.url.searchParams.get("pg_disabled") ?? "false") === "true"
  state playground_readonly = (ctx.url.searchParams.get("pg_readonly") ?? "false") === "true"
  state playground_required = (ctx.url.searchParams.get("pg_required") ?? "false") === "true"
  state playground_invalid = (ctx.url.searchParams.get("pg_invalid") ?? "false") === "true"
  state playground_helpText = ctx.url.searchParams.get("pg_helpText") ?? ""
  state playground_validationMessage = ctx.url.searchParams.get("pg_validationMessage") ?? ""
  state playground_class = ctx.url.searchParams.get("pg_class") ?? ""
  seo {
    title = "Toggle Password"
    description = "Accessible password field with optional show and hide controls."
  }
  view {
    <nav class="docs-breadcrumbs" aria-label="Breadcrumb">
      <a href="/">Components</a><span aria-hidden="true">/</span><a href="/advanced-forms">Advanced Forms</a><span aria-hidden="true">/</span><span>Toggle Password</span>
    </nav>
    <header class="detail-hero">
      <div class="detail-hero-copy">
        <span class="showcase-eyebrow">Advanced Forms component</span>
        <h1>Toggle Password</h1>
        <p>Accessible password field with optional show and hide controls.</p>
        <div class="detail-badges"><span>24 props</span><span>0 slots</span><span>3 outputs</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="TogglePassword" data-playground-public-tag="true" data-playground-has-slot="false" data-playground-events="input,change,toggle">
      <div class="detail-section-heading"><span>Interactive playground</span><h2>Configure Toggle Password</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><TogglePassword size='{playground_size}' color='{playground_color}' label='{playground_label}' name='{playground_name}' value='{playground_value}' placeholder='{playground_placeholder}' autocomplete='{playground_autocomplete}' minlength='{playground_minlength}' maxlength='{playground_maxlength}' pattern='{playground_pattern}' fields='{playground_fields}' visible='{playground_visible}' toggleable='{playground_toggleable}' toggleMode='{playground_toggleMode}' checkboxLabel='{playground_checkboxLabel}' showLabel='{playground_showLabel}' hideLabel='{playground_hideLabel}' disabled='{playground_disabled}' readonly='{playground_readonly}' required='{playground_required}' invalid='{playground_invalid}' helpText='{playground_helpText}' validationMessage='{playground_validationMessage}' class='{playground_class}' /></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;TogglePassword
  name="toggle-password-1"
  value="Northstar!2026"
  maxlength="128"
  fields='[]'
/&gt;</code></pre>
          </section>
          <div class="playground-status" data-playground-status aria-live="polite"></div>
          <div class="playground-event-log" data-playground-event-log aria-live="polite"><strong>Event output</strong><span>Interact with the preview to inspect the typed <code>payload</code>.</span></div>
        </div>
        <form class="playground-controls" data-playground-form>
          <header><div><span>Component props</span><strong>24 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-toggle-password-size"><span><strong>size</strong><small>string</small></span><select id="playground-toggle-password-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-toggle-password-color"><span><strong>color</strong><small>string</small></span><select id="playground-toggle-password-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-toggle-password-label"><span><strong>label</strong><small>string</small></span><input id="playground-toggle-password-label" name="pg_label" type="text" value="Password" /></label><label class="playground-field" for="playground-toggle-password-name"><span><strong>name</strong><small>string</small></span><input id="playground-toggle-password-name" name="pg_name" type="text" value="toggle-password-1" /></label><label class="playground-field" for="playground-toggle-password-value"><span><strong>value</strong><small>string</small></span><input id="playground-toggle-password-value" name="pg_value" type="text" value="Northstar!2026" /></label><label class="playground-field" for="playground-toggle-password-placeholder"><span><strong>placeholder</strong><small>string</small></span><input id="playground-toggle-password-placeholder" name="pg_placeholder" type="text" value="Enter your password" /></label><label class="playground-field" for="playground-toggle-password-autocomplete"><span><strong>autocomplete</strong><small>string</small></span><input id="playground-toggle-password-autocomplete" name="pg_autocomplete" type="text" value="current-password" /></label><label class="playground-field" for="playground-toggle-password-minlength"><span><strong>minlength</strong><small>string</small></span><input id="playground-toggle-password-minlength" name="pg_minlength" type="text" value="" /></label><label class="playground-field" for="playground-toggle-password-maxlength"><span><strong>maxlength</strong><small>string</small></span><input id="playground-toggle-password-maxlength" name="pg_maxlength" type="text" value="128" /></label><label class="playground-field" for="playground-toggle-password-pattern"><span><strong>pattern</strong><small>string</small></span><input id="playground-toggle-password-pattern" name="pg_pattern" type="text" value="(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}" /></label><label class="playground-field" for="playground-toggle-password-fields"><span><strong>fields</strong><small>unknown[]</small></span><textarea id="playground-toggle-password-fields" name="pg_fields" rows="5" spellcheck="false" data-playground-json>[]</textarea><em data-playground-error></em></label><label class="playground-toggle" for="playground-toggle-password-visible"><span><strong>visible</strong><small>boolean</small></span><input id="playground-toggle-password-visible" name="pg_visible" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-toggle-password-toggleable"><span><strong>toggleable</strong><small>boolean</small></span><input id="playground-toggle-password-toggleable" name="pg_toggleable" type="checkbox" value="true" checked data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-field" for="playground-toggle-password-toggleMode"><span><strong>toggle Mode</strong><small>string</small></span><input id="playground-toggle-password-toggleMode" name="pg_toggleMode" type="text" value="button" /></label><label class="playground-field" for="playground-toggle-password-checkboxLabel"><span><strong>checkbox Label</strong><small>string</small></span><input id="playground-toggle-password-checkboxLabel" name="pg_checkboxLabel" type="text" value="Show password" /></label><label class="playground-field" for="playground-toggle-password-showLabel"><span><strong>show Label</strong><small>string</small></span><input id="playground-toggle-password-showLabel" name="pg_showLabel" type="text" value="Show password" /></label><label class="playground-field" for="playground-toggle-password-hideLabel"><span><strong>hide Label</strong><small>string</small></span><input id="playground-toggle-password-hideLabel" name="pg_hideLabel" type="text" value="Hide password" /></label><label class="playground-toggle" for="playground-toggle-password-disabled"><span><strong>disabled</strong><small>boolean</small></span><input id="playground-toggle-password-disabled" name="pg_disabled" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-toggle-password-readonly"><span><strong>readonly</strong><small>boolean</small></span><input id="playground-toggle-password-readonly" name="pg_readonly" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-toggle-password-required"><span><strong>required</strong><small>boolean</small></span><input id="playground-toggle-password-required" name="pg_required" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-toggle-password-invalid"><span><strong>invalid</strong><small>boolean</small></span><input id="playground-toggle-password-invalid" name="pg_invalid" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-field" for="playground-toggle-password-helpText"><span><strong>help Text</strong><small>string</small></span><input id="playground-toggle-password-helpText" name="pg_helpText" type="text" value="" /></label><label class="playground-field" for="playground-toggle-password-validationMessage"><span><strong>validation Message</strong><small>string</small></span><input id="playground-toggle-password-validationMessage" name="pg_validationMessage" type="text" value="" /></label><label class="playground-field" for="playground-toggle-password-class"><span><strong>class</strong><small>string</small></span><input id="playground-toggle-password-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">Visibility</span><h2>Inline visibility button</h2><p>Live inline visibility button example with accessible visibility controls and copyable component code.</p></div>
          <span class="demo-case-number">01</span>
        </header>
        <div class="demo-workbench">
          <div id="toggle-password-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"><TogglePassword size="default" label="Password" name="toggle-password-1" value="Northstar!2026" placeholder="Enter your password" autocomplete="current-password" minlength="" maxlength="128" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}" fields='[]' visible="false" toggleable="true" toggleMode="button" checkboxLabel="Show password" disabled="false" readonly="false" required="false" invalid="false" helpText="" validationMessage="" /></div>
          </div>
          <section class="demo-code" aria-label="Inline visibility button 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;TogglePassword
  name="toggle-password-1"
  value="Northstar!2026"
  maxlength="128"
  fields='[]'
/&gt;</code></pre>
          </section>
        </div>
      </article>
      <article class="demo-case">
        <header class="demo-case-header">
          <div><span class="demo-case-eyebrow">Visibility</span><h2>Checkbox-controlled toggle</h2><p>Live checkbox-controlled toggle example with accessible visibility controls and copyable component code.</p></div>
          <span class="demo-case-number">02</span>
        </header>
        <div class="demo-workbench">
          <div id="toggle-password-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"><TogglePassword size="default" label="Checkbox-controlled toggle" name="toggle-password-2" value="Northstar!2026" placeholder="Enter your password" autocomplete="current-password" minlength="" maxlength="128" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}" fields='[]' visible="false" toggleable="true" toggleMode="checkbox" checkboxLabel="Show password" disabled="false" readonly="false" required="false" invalid="false" helpText="" validationMessage="" /></div>
          </div>
          <section class="demo-code" aria-label="Checkbox-controlled toggle 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;TogglePassword
  label="Checkbox-controlled toggle"
  name="toggle-password-2"
  value="Northstar!2026"
  maxlength="128"
  fields='[]'
  toggleMode="checkbox"
/&gt;</code></pre>
          </section>
        </div>
      </article>
      <article class="demo-case">
        <header class="demo-case-header">
          <div><span class="demo-case-eyebrow">Visibility</span><h2>Synchronized password fields</h2><p>Live synchronized password fields example with accessible visibility controls and copyable component code.</p></div>
          <span class="demo-case-number">03</span>
        </header>
        <div class="demo-workbench">
          <div id="toggle-password-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"><TogglePassword size="default" label="Passwords" name="toggle-password-3" value="" placeholder="Enter your password" autocomplete="current-password" minlength="" maxlength="128" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}" fields='[{"label":"New password","name":"new-password","placeholder":"Enter new password","autocomplete":"new-password"},{"label":"Current password","name":"current-password","value":"Northstar!2026","autocomplete":"current-password"}]' visible="false" toggleable="true" toggleMode="button" checkboxLabel="Show password" disabled="false" readonly="false" required="false" invalid="false" helpText="" validationMessage="" /></div>
          </div>
          <section class="demo-code" aria-label="Synchronized password fields 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;TogglePassword
  label="Passwords"
  name="toggle-password-3"
  maxlength="128"
  fields='[
    <span>&#123;</span>
      "label": "New password",
      "name": "new-password",
      "placeholder": "Enter new password",
      "autocomplete": "new-password"
    <span>&#125;</span>,
    <span>&#123;</span>
      "label": "Current password",
      "name": "current-password",
      "value": "Northstar!2026",
      "autocomplete": "current-password"
    <span>&#125;</span>
  ]'
/&gt;</code></pre>
          </section>
        </div>
      </article>
      <article class="demo-case">
        <header class="demo-case-header">
          <div><span class="demo-case-eyebrow">Visibility</span><h2>Without visibility toggle</h2><p>Live without visibility toggle example with accessible visibility controls and copyable component code.</p></div>
          <span class="demo-case-number">04</span>
        </header>
        <div class="demo-workbench">
          <div id="toggle-password-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"><TogglePassword size="default" label="Without visibility toggle" name="toggle-password-4" value="" placeholder="Enter your password" autocomplete="current-password" minlength="" maxlength="128" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}" fields='[]' visible="false" toggleable="false" toggleMode="button" checkboxLabel="Show password" disabled="false" readonly="false" required="false" invalid="false" helpText="" validationMessage="" /></div>
          </div>
          <section class="demo-code" aria-label="Without visibility toggle 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;TogglePassword
  label="Without visibility toggle"
  name="toggle-password-4"
  maxlength="128"
  fields='[]'
  toggleable="false"
/&gt;</code></pre>
          </section>
        </div>
      </article>
      <article class="demo-case">
        <header class="demo-case-header">
          <div><span class="demo-case-eyebrow">Forms & states</span><h2>Supporting help text</h2><p>Live supporting help text example with accessible visibility controls and copyable component code.</p></div>
          <span class="demo-case-number">05</span>
        </header>
        <div class="demo-workbench">
          <div id="toggle-password-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"><TogglePassword size="default" label="Supporting help text" name="toggle-password-5" value="" placeholder="Enter your password" autocomplete="current-password" minlength="" maxlength="128" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}" fields='[]' visible="false" toggleable="true" toggleMode="button" checkboxLabel="Show password" disabled="false" readonly="false" required="false" invalid="false" helpText="Use at least eight characters and avoid passwords used on other sites." validationMessage="" /></div>
          </div>
          <section class="demo-code" aria-label="Supporting help text 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;TogglePassword
  label="Supporting help text"
  name="toggle-password-5"
  maxlength="128"
  fields='[]'
  helpText="Use at least eight characters and avoid passwords used on other sites."
/&gt;</code></pre>
          </section>
        </div>
      </article>
      <article class="demo-case">
        <header class="demo-case-header">
          <div><span class="demo-case-eyebrow">Forms & states</span><h2>Required validation</h2><p>Live required validation example with accessible visibility controls and copyable component code.</p></div>
          <span class="demo-case-number">06</span>
        </header>
        <div class="demo-workbench">
          <div id="toggle-password-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"><form data-schema="toggle-password-validation" class="demo-validation-form"><TogglePassword size="default" label="Required validation" name="toggle-password-6" value="" placeholder="Enter your password" autocomplete="current-password" minlength="8" maxlength="128" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}" fields='[]' visible="false" toggleable="true" toggleMode="button" checkboxLabel="Show password" disabled="false" readonly="false" required="true" invalid="false" helpText="" validationMessage="" /><button type="submit" class="wire-btn wire-btn--variant-default">Validate selection</button></form></div>
          </div>
          <section class="demo-code" aria-label="Required validation 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;TogglePassword
  label="Required validation"
  name="toggle-password-6"
  minlength="8"
  maxlength="128"
  fields='[]'
  required="true"
/&gt;</code></pre>
          </section>
        </div>
      </article>
      <article class="demo-case">
        <header class="demo-case-header">
          <div><span class="demo-case-eyebrow">Forms & states</span><h2>Disabled password</h2><p>Live disabled password example with accessible visibility controls and copyable component code.</p></div>
          <span class="demo-case-number">07</span>
        </header>
        <div class="demo-workbench">
          <div id="toggle-password-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"><TogglePassword size="default" label="Disabled password" name="toggle-password-7" value="" placeholder="Enter your password" autocomplete="current-password" minlength="" maxlength="128" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}" fields='[]' visible="false" toggleable="true" toggleMode="button" checkboxLabel="Show password" disabled="true" readonly="false" required="false" invalid="false" helpText="" validationMessage="" /></div>
          </div>
          <section class="demo-code" aria-label="Disabled password 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;TogglePassword
  label="Disabled password"
  name="toggle-password-7"
  maxlength="128"
  fields='[]'
  disabled="true"
/&gt;</code></pre>
          </section>
        </div>
      </article>
      <article class="demo-case">
        <header class="demo-case-header">
          <div><span class="demo-case-eyebrow">Forms & states</span><h2>Read-only password</h2><p>Live read-only password example with accessible visibility controls and copyable component code.</p></div>
          <span class="demo-case-number">08</span>
        </header>
        <div class="demo-workbench">
          <div id="toggle-password-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"><TogglePassword size="default" label="Read-only password" name="toggle-password-8" value="Northstar!2026" placeholder="Enter your password" autocomplete="current-password" minlength="" maxlength="128" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}" fields='[]' visible="false" toggleable="true" toggleMode="button" checkboxLabel="Show password" disabled="false" readonly="true" required="false" invalid="false" helpText="" validationMessage="" /></div>
          </div>
          <section class="demo-code" aria-label="Read-only password 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;TogglePassword
  label="Read-only password"
  name="toggle-password-8"
  value="Northstar!2026"
  maxlength="128"
  fields='[]'
  readonly="true"
/&gt;</code></pre>
          </section>
        </div>
      </article>
      <article class="demo-case">
        <header class="demo-case-header">
          <div><span class="demo-case-eyebrow">Design & events</span><h2>Large password field</h2><p>Live large password field example with accessible visibility controls and copyable component code.</p></div>
          <span class="demo-case-number">09</span>
        </header>
        <div class="demo-workbench">
          <div id="toggle-password-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"><TogglePassword size="lg" label="Large password field" name="toggle-password-9" value="" placeholder="Enter your password" autocomplete="current-password" minlength="" maxlength="128" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}" fields='[]' visible="false" toggleable="true" toggleMode="button" checkboxLabel="Show password" disabled="false" readonly="false" required="false" invalid="false" helpText="" validationMessage="" /></div>
          </div>
          <section class="demo-code" aria-label="Large password field 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;TogglePassword
  size="lg"
  label="Large password field"
  name="toggle-password-9"
  maxlength="128"
  fields='[]'
/&gt;</code></pre>
          </section>
        </div>
      </article>
      <article class="demo-case">
        <header class="demo-case-header">
          <div><span class="demo-case-eyebrow">Design & events</span><h2>Toggle events</h2><p>Live toggle events example with accessible visibility controls and copyable component code.</p></div>
          <span class="demo-case-number">010</span>
        </header>
        <div class="demo-workbench">
          <div id="toggle-password-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"><TogglePassword size="default" label="Toggle events" name="toggle-password-10" value="" placeholder="Enter your password" autocomplete="current-password" minlength="" maxlength="128" pattern="(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).{8,}" fields='[]' visible="false" toggleable="true" toggleMode="button" checkboxLabel="Show password" disabled="false" readonly="false" required="false" invalid="false" helpText="" validationMessage="" /></div>
          </div>
          <section class="demo-code" aria-label="Toggle events 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;TogglePassword
  label="Toggle events"
  name="toggle-password-10"
  maxlength="128"
  fields='[]'
/&gt;</code></pre>
          </section>
        </div>
      </article></div></section>
        <section id="events" class="detail-section"><div class="detail-section-heading"><span>Component outputs</span><h2>Receive every typed component output</h2><p>Use declarative output handlers in <code>.wrn</code> files or register a direct output handler from JavaScript. The canonical API exposes <code>payload</code> and does not require <code>event.detail</code>.</p></div><div class="detail-events-grid"><div class="detail-events-list"><div><code>@input</code><span>Fires as the editable value changes.</span></div><div><code>@change</code><span>Fires when the component's committed value or selection changes.</span></div><div><code>@toggle</code><span>Fires when the component changes between open and closed or on and off states.</span></div></div><div class="detail-event-examples"><section class="demo-code"><header><span><span class="icon-[lucide--braces] size-4" aria-hidden="true"></span>Declarative handlers</span><small>.wrn</small></header><pre><code>&lt;TogglePassword
  @input='console.log(payload)'
  @change='console.log(payload)'
  @toggle='console.log(payload)'
/&gt;</code></pre></section><section class="demo-code"><header><span><span class="icon-[lucide--radio] size-4" aria-hidden="true"></span>Direct output handlers</span><small>.js</small></header><pre><code>import <span>&#123;</span> registerOutputHandler <span>&#125;</span> from "@wrnexus/csr/outputs"

const component = document.querySelector("[data-ui-component=\"TogglePassword\"], [data-component=\"TogglePassword\"]")

if (component) registerOutputHandler(component, "input", (payload) =&gt; <span>&#123;</span>
  console.log("input", payload)
<span>&#125;</span>)

if (component) registerOutputHandler(component, "change", (payload) =&gt; <span>&#123;</span>
  console.log("change", payload)
<span>&#125;</span>)

if (component) registerOutputHandler(component, "toggle", (payload) =&gt; <span>&#123;</span>
  console.log("toggle", payload)
<span>&#125;</span>)</code></pre></section></div></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>label</code></td><td>string</td><td><code>"Password"</code></td><td>No</td></tr><tr><td><code>name</code></td><td>string</td><td><code>"password"</code></td><td>No</td></tr><tr><td><code>value</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>placeholder</code></td><td>string</td><td><code>"Enter your password"</code></td><td>No</td></tr><tr><td><code>autocomplete</code></td><td>string</td><td><code>"current-password"</code></td><td>No</td></tr><tr><td><code>minlength</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>maxlength</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>pattern</code></td><td>string</td><td><code>"(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9]).<span>&#123;</span>8,<span>&#125;</span>"</code></td><td>No</td></tr><tr><td><code>fields</code></td><td>unknown[]</td><td><code>[]</code></td><td>No</td></tr><tr><td><code>visible</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>toggleable</code></td><td>boolean</td><td><code>true</code></td><td>No</td></tr><tr><td><code>toggleMode</code></td><td>string</td><td><code>"button"</code></td><td>No</td></tr><tr><td><code>checkboxLabel</code></td><td>string</td><td><code>"Show password"</code></td><td>No</td></tr><tr><td><code>showLabel</code></td><td>string</td><td><code>"Show password"</code></td><td>No</td></tr><tr><td><code>hideLabel</code></td><td>string</td><td><code>"Hide password"</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>readonly</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>invalid</code></td><td>boolean</td><td><code>false</code></td><td>No</td></tr><tr><td><code>helpText</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>validationMessage</code></td><td>string</td><td><code>""</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="#toggle-password-demo-1">Inline visibility button</a><a href="#toggle-password-demo-2">Checkbox-controlled toggle</a><a href="#toggle-password-demo-3">Synchronized password fields</a><a href="#toggle-password-demo-4">Without visibility toggle</a><a href="#toggle-password-demo-5">Supporting help text</a><a href="#toggle-password-demo-6">Required validation</a><a href="#toggle-password-demo-7">Disabled password</a><a href="#toggle-password-demo-8">Read-only password</a><a href="#toggle-password-demo-9">Large password field</a><a href="#toggle-password-demo-10">Toggle events</a><a href="#events">Outputs</a><a href="#api">Props API</a></div>
      </aside>
    </div>
    <nav class="detail-pagination">
      <a href="/components/toggle-count"><small>Previous</small><strong>← Toggle Count</strong></a>
      <span></span>
    </nav>
  }
}
