Toggle • Concept Alpha

A high-performance switch component with Indigo primary feedback and accessible aria-role implementation.

Indigo Theme React WCAG AAA

Interactive Explorer

Component Anatomy

Parts & Properties

Toggle Track

The sliding background track that transitions from gray to Indigo-600 when enabled.

Switch Thumb

The physical circular switch that slides 18px across the track with 200ms duration.

Development Resources

// ExperimentToggle.tsx
const ExperimentToggle = ({ enabled, onChange }) => (
  <label className="relative inline-block w-10 h-6">
    <input type="checkbox" className="sr-only" checked={enabled} onChange={onChange} />
    <div className={`w-10 h-6 rounded-full transition-colors ${enabled ? 'bg-indigo-600' : 'bg-gray-200'}`} />
    <div className={`absolute left-1 top-1 bg-white w-4 h-4 rounded-full transition-transform ${enabled ? 'translate-x-4' : ''}`} />
  </label>
);