coss.com Svelte

Label

Renders an accessible label associated with controls.

Loading p-input-6 preview…

Installation

pnpm dlx shadcn-svelte@latest add https://coss-sv.vercel.app/r/label.json

Usage

<script lang="ts">
  import { Label } from "$lib/components/ui/label/index.js";
</script>

<Label for="email">Email</Label>

API Reference

This is a native Svelte label wrapper rather than a Shards UI part.

Label

A label component that can render as a different element.

PropTypeDefaultDescription
askeyof HTMLElementTagNameMap"label"Renders a different element

Examples

For accessible labelling and validation, prefer using Field.Label. See some related examples.

With Checkbox

Loading p-checkbox-1 preview…