Hoppa till innehåll

TagSelector

Wrapper for Sitevision tag selector.

TagSelector

PropTypeDescription
idstringUnique identifier for the component.
Default: generateId()
namestringName attribute for the tag selector.
labelstringLabel for the tag selector.
descriptionstringDescription text displayed below the input field.
requiredbooleanIf the field is required.
Default: false
disabledbooleanIf the field is disabled.
Default: false
showbooleanShow or hide the component without re-rendering.
Default: true
valueArrayBound value for the tag selector.
Default: []
<script>
import { Panel, TagSelector } from '@soleil-se/config-svelte';
</script>
<Panel heading="Inställningar">
<TagSelector name="tags" label="Etiketter" />
</Panel>
Advanced

Name prop is required here as well since Sitevision uses this to initialize the component.

<script>
import { Panel, TagSelector } from '@soleil-se/config-svelte';
import { onSave } from '@soleil-se/config-svelte/utils';
const values = {
tags: [],
...window.CONFIG_VALUES
};
onSave(() => values);
</script>
<Panel heading="Inställningar">
<TagSelector bind:value={values.tags} label="Etiketter" name="tags" />
</Panel>

Default slot after select.

<TagSelector name="tags" label="Etiketter" />
<p>Some text</p>
</TagSelector>

Slot for content in the label element.

<TagSelector name="tags">
{#snippet label()}
Custom <strong>label</strong>
{/snippet}
</TagSelector>

Slot for content in the description element to be used instead of the prop when HTML formatting is needed.

<TagSelector name="tags">
{#snippet description()}
Custom <strong>description</strong>
{/snippet}
</TagSelector>