Label
A caption naming or describing a form element.
Code
<script lang="ts">
import { Label } from '@geoffcox/sterling-svelte';
</script>
<Label vertical="undefined">sterling-svelte</Label>
Members
| Property Name | Type | Default | Comment |
---|
| forwardClick | string | false |
| message | string | Snippet | '' |
| required | string | false |
| requiredIndicator | string | Snippet | '' |
| requiredReason | string | Snippet | '' |
| text | string | Snippet | '' |
Considerations
- An optional message and status can provide information to the user about their value.
- The required property and requiredReason indicate the user must fill in a value and why.
- Includes HTMLLabelElement props, events, and methods.
Anatomy
<label class="sterling-label">
<div class="text">
{@render text()}
</div>
<div class="content">
{@render children()}
</div>
<div class="message">
{@render message()}
</div>
<Tooltip>
<div class="required">
{@render requiredIndicator()}
</div>
{#snippet tip()}
{@render requiredReason()}
{/snippet}
</ToolTip>
</label>