Switch

Switches are toggle controls for binary on/off settings.


Installation

npm install @libretexts/davis-react

Basic Usage

import { Switch } from '@libretexts/davis-react';
import { useState } from 'react';

export default function Example() {
  const [enabled, setEnabled] = useState(false);

  return (
    <Switch
      checked={enabled}
      onChange={setEnabled}
      label="Enable notifications"
    />
  );
}

Documentation in Progress

Full documentation for this component is being written. Check back soon for complete API reference, examples, and accessibility guidelines.