Form Label
Renders the label for a form control: label text plus a required indicator. Used internally by the input family; also available for custom controls that need the same label markup.
Playground
label
size
required
<FormLabel
label="Email"
/>Default
vue
<script setup lang="ts">
import { FormLabel } from 'frappe-ui'
</script>
<template>
<FormLabel label="Email" />
</template>Required
vue
<script setup lang="ts">
import { FormLabel } from 'frappe-ui'
</script>
<template>
<FormLabel label="Name" required />
</template>API Reference
Show types
typescript
export interface FormLabelProps {
/** Text content of the label. */
label: string
/** Size of the label text. */
size?: 'sm' | 'md'
/** id of the form control this label is for; wired to the `for` attribute. */
id?: string
/** Marks the field as required; renders an asterisk and an accessible "(required)" note. */
required?: boolean
}label*
string
Text content of the label.
size
= "sm""sm" | "md"
Size of the label text.
id
string
id of the form control this label is for; wired to the `for` attribute.
required
boolean
Marks the field as required; renders an asterisk and an accessible "(required)" note.