error
Description
Optional. Defines whether error styling is applied to a MultiComboUsage
error?: boolean;
Parameters
- true - error styling is applied
- false - (default) error styling is not applied
Example
<script>
const dataset = [
{id:1, label:"First option"},
{id:2, label:"Second option"},
{id:3, label:"Third option"}
]
</script>
<MultiCombo options={dataset} value={[1,2]} error={true}/>
Details
The property is useful during a form validation. If the property is set to true
a MultiCombo gets red error styling.
To add a red error label for the control, use the error property of the Field control:
<script>
import { MultiCombo, Field } from "@svar-ui/svelte-core";
</script>
<Field label="Error message" error={true}>
{#snippet children(id)} <MultiCombo {id} error={true}/> {/snippet}
</Field>
Related article: Styling an option validation error
Related sample: MultiCombo