Forms Core Stable

Label

A form label with a decorative required asterisk, wired to a FormField's context when it has one

Preview

Installation

pnpm add fancy-ui-svelte
import { Label } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { Label } from 'fancy-ui-svelte';
</script>

<Label />

Examples

Basic Usage

Required

The asterisk is decoration — the accessible cue is the control's own required.

With FormField

for and required resolve from context — nothing to wire by hand.

Props

PropTypeDefaultDescription
for string-Explicit target id. Inside a FormField, the field's own control id wins
required booleanfalseRenders the required asterisk. Inside a FormField, the field's own `required` wins
class string-Additional CSS classes
ref HTMLLabelElement | nullnullBindable element reference

Slots

SlotDescription
childrenThe label text/content