Comparación entre la versión Astro (Saastro) y React (shadcn/ui)
🚀 saastro/ui (Astro)
⚛️ shadcn/ui (React)
Installation
Usage
---
import { Label } from "@/components/ui-saastro/label"
---
<Label for="email">Your email address</Label>
Examples
With Input
---
import { Input } from "@/components/ui-saastro/input"
import { Label } from "@/components/ui-saastro/label"
---
<div class="grid w-full max-w-sm items-center gap-1.5">
<Label for="email">Email</Label>
<Input type="email" id="email" placeholder="Email" />
</div>
With Checkbox
---
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>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
for | string | - | The id of the element this label is associated with |
class | string | - | Additional CSS classes |
Accessibility
- Uses native
<label>element for built-in accessibility - Clicking the label focuses/activates the associated control
- Properly associates with form controls via the
forattribute - Inherits disabled state styling from peer elements