@neynar/ui
Version:
React UI component library built on shadcn/ui and Tailwind CSS
76 lines (60 loc) • 1.85 kB
Markdown
# Switch
**Type**: component
Switch - Binary toggle control for on/off states A versatile toggle switch component built on Radix UI Switch primitive that provides an accessible way to toggle between on/off states. Commonly used for settings, preferences, and feature toggles that have immediate effects. Built with Radix UI Switch primitive and styled with Tailwind CSS to ensure consistent visual appearance across light and dark themes. The component automatically handles state management, accessibility, keyboard navigation, and form integration.
## JSX Usage
```jsx
import { Switch } from '@neynar/ui';
<Switch
checked={true}
defaultChecked={true}
onCheckedChange={handleCheckedChange}
disabled={true}
required={true}
name="value"
value="value"
id="value"
asChild={true}
className="value"
/>
```
## Component Props
### checked
- **Type**: `boolean`
- **Required**: No
- **Description**: No description available
### defaultChecked
- **Type**: `boolean`
- **Required**: No
- **Description**: No description available
### onCheckedChange
- **Type**: `(checked: boolean) => void`
- **Required**: No
- **Description**: No description available
### disabled
- **Type**: `boolean`
- **Required**: No
- **Description**: No description available
### required
- **Type**: `boolean`
- **Required**: No
- **Description**: No description available
### name
- **Type**: `string`
- **Required**: No
- **Description**: No description available
### value
- **Type**: `string`
- **Required**: No
- **Description**: No description available
### id
- **Type**: `string`
- **Required**: No
- **Description**: No description available
### asChild
- **Type**: `boolean`
- **Required**: No
- **Description**: No description available
### className
- **Type**: `string`
- **Required**: No
- **Description**: No description available