Comparación entre la versión Astro (Saastro) y React (shadcn/ui)
🚀 saastro/ui (Astro)
⚛️ shadcn/ui (React)
Installation
Usage
---
import { Checkbox } from "@/components/ui-saastro/checkbox"
import { Label } from "@/components/ui-saastro/label"
---
<div class="flex items-center space-x-2">
<Checkbox id="terms" />
<Label for="terms">Accept terms and conditions</Label>
</div>
Examples
Default
<Checkbox />
With Label
<div class="flex items-center space-x-2">
<Checkbox id="terms" />
<Label for="terms">Accept terms</Label>
</div>
Checked by Default
<Checkbox checked />
Disabled
<Checkbox disabled />
Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | false | Whether the checkbox is checked |
disabled | boolean | false | Whether the checkbox is disabled |
class | string | - | Additional CSS classes |
Accessibility
- Uses native
<input type="checkbox">for built-in accessibility - Associate with
<Label>using matchingidandforattributes - Supports keyboard navigation (Space to toggle)
- Properly conveys checked state to screen readers