canonrs-server 0.1.0

CanonRS server-side rendering support
id: toggle
label: Toggle
family: family-c-forms
category: Form
intent: Toggle a pressed state
description: Toggle button
composable: false
capabilities: Pressed, Disabled
required_parts: []
optional_parts: []
tags: ["toggle", "activate", "button", "on", "off", "press"]
keywords: 
pain: Toggle buttons desync pressed state and visual representation
promise: Pressed state mapped directly to DOM and interaction state
why: |
  TogglePrimitive maps ToggleState to data-rs-state and checkbox checked state. Disabled and aria-label are enforced. This guarantees consistent toggle behavior.
rules: ["CR-001", "CR-004"]
use_cases: ["formatting tools", "feature toggles"]
related: ["switch", "toggle_group"]
file: toggle_ui.css
tokens: toggle-*, size-*, radius-*, motion-*, font-*
foundation: size, radius, motion, typography
states: ["on", "off", "disabled"]
island: toggle_boundary.rs
pillar: toggle
badges: ["SSR Safe", "Hydration Safe", "Token Driven", "Deterministic API", "Zero Drift", "Island Architecture"]
before: |
  // ❌ Typical
  view! {
    <button class="active">"On"</button>
  }
after: |
  // ✅ CanonRS
  view! {
    <Toggle pressed=true>"On"</Toggle>
  }
boundary_type: init
block: []
blocks_primitives: [stack]