Field API Overview
Initialization
<script>
import { Field, Control } from "@svar-ui/svelte-core";
</script>
<!-- the Field control contains another control and provides a label for it -->
<!-- the field and the control inside are linked by the id -->
<Field label="Text">
{#snippet children(id)}
<Control {id} />
{/snippet}
</Field>
tip
- Visit the Features Guide to learn more about the control's functionality.
- Explore the samples to visualize the available features.
Field Properties
error | Optional. Defines whether error styling is applied to the control's label |
label | Optional. Sets a label for the control inside a field |
position | Optional. Sets the position of a label relative to the control |
required | Optional. Marks a field as required |
type | Optional. Sets the control's type for correct positioning of a left-side label |
width | Optional. Sets the width needed for a field to nest a control |