DropdownSelector
Generic wrapper for Sitevision select components used for selecting nodes.
This is a field description.
Prefer the specialized wrappers for ordinary usage:
- MetadataSelector
- TemplateSelector
- Oauth2ConfigurationSelector
- VirtualGroupSelector
- SearchIndexSelector
- FontSelector
- ColorSelector
- LLMConfigurationSelector
- TargetAudienceSelector
Use DropdownSelector when you need to configure the selector component directly.
Example
Section titled “Example”<script> import { DropdownSelector } from '@soleil-se/config-svelte';</script>
<DropdownSelector name="metadata" component="metadata" label="Metadata" />| Prop | Type | Description |
|---|---|---|
componentrequired | string | Sitevision component. |
labelrequired | string | Snippet | Field label, a string or Svelte snippet. |
value$bindable | string | Selected node ID. |
types | string | string[] | Filters selectable types for components that support filtering. Accepts one type, array or a comma-separated string. |
name | string | Configuration key and HTML name attribute. |
description | string | Snippet | Description shown below the field, a string or Svelte snippet. |
required | boolean | Set the field as required. Default:false |
disabled | boolean | Disables the field. Default:false |
show | boolean | Shows or hides the selector without destroying it. Default:true |
class | string | CSS class added to the form-group wrapper. |
children | Snippet | Content rendered after the selector and validation message. |
onChange | function | Called on a selection change. |
validate | function | Custom validator. |
For custom options, use CustomSelector.
For tags, use TagSelector.
Validation
Section titled “Validation”By default, the component applies standard required-field validation. A custom validate prop
replaces that default and returns { success: boolean, message?: string }.
Validation errors are displayed below the component and prevent saving.
See validation for more details.
Snippets
Section titled “Snippets”label and description accept text or Svelte snippets.
Default child content is rendered after the select and validation message.
<script> import { DropdownSelector } from '@soleil-se/config-svelte';</script>
<DropdownSelector name="metadata" component="metadata"> {#snippet label()} Välj <strong>metadata</strong> {/snippet} {#snippet description()} Välj metadata för <strong>innehållet</strong>. {/snippet} <p>Ytterligare information.</p></DropdownSelector>