Studio
2

Label

Installation

pnpm dlx @mielui/svelte add label

Usage

Match for to the input id. Set required on the input when showing a required indicator. Apply disabled styling to the label explicitly when it precedes the control.

import { Label } from '$lib/mielui/components/label';
import { Input } from '$lib/mielui/components/input';

<Label for="email">Email</Label>
<Input id="email" type="email" />

Examples

With required indicator

Disabled field

API reference

Label

Labels a form control.

Prop Type Default
class (string & (ClassValue | null)) | undefined —
children Snippet<[]> | undefined —