Label
Renders a native label and passes through its attributes. When it follows a disabled
control that has the peer class, it
dims to match.
Installation
Copy the command below and run it in your terminal.
Usage
Set for to the control's id. Input and Textarea render their own
label when you pass label, so use Label
for custom layouts.
Examples
With required indicator
Disabled field
Anatomy
Label - Labels a form control.
<script lang="ts"> import { Input } from '@sivir-ui/svelte/components/input'; import { Label } from '@sivir-ui/svelte/components/label'; </script> <div class="flex flex-col gap-1.5"> <Label for="email">Email address</Label> <Input id="email" type="email" placeholder="you@sivir.dev" /> </div>