Size
Palette
Elevation
Rounded
list Basic
Select your country of residence
Selected: none
search Searchable
Selected: none
view_agenda Header & Footer slots
Selected: none
verified Validation states
Please select a role

States


Normal
Hint
We'll use this for shipping
Error
This field is required
Success
Country selected
Disabled
Searchable


Svelte
<script lang="ts">
    let country: string | undefined = $state(undefined);

    const countries = [
        { value: "fr", label: "France" },
        { value: "de", label: "Germany" },
        { value: "es", label: "Spain" },
    ];
</script>

<Select
    bind:value={country}
    options={countries}
    label="Country"
    placeholder="Choose a country"
    hint="Select your country of residence"
/>

API


package_2

import type { PopoverPalette, PopoverElevation, PopoverDirection, PopoverAlign } from '@abhc/spektral-ui';
PropTypeDefault
valueTβ€”
optionsreadonly (T | OptionEntry)[]β€”
placeholderstring"Select an option"
labelstringβ€”
hintstringβ€”
errorstringβ€”
successstringβ€”
size"sm" | "md" | "lg""md"
disabledbooleanfalse
requiredbooleanfalse
searchablebooleanfalse
searchPlaceholderstring"Search..."
namestringβ€”
idstringβ€”
onchange(value: T) => voidβ€”
leadingSnippetβ€”
trailingSnippetβ€”
palette"tone" | "accent" | "accentbg""tone"
roundedbooleanfalse
elevation"none" | "subtle" | "hard""none"
direction"bottom" | "top" | "left" | "right""bottom"
Prop value
Type T
Default β€”
Prop options
Type readonly (T | OptionEntry)[]
Default β€”
Prop placeholder
Type string
Default "Select an option"
Prop label
Type string
Default β€”
Prop hint
Type string
Default β€”
Prop error
Type string
Default β€”
Prop success
Type string
Default β€”
Prop size
Type "sm" | "md" | "lg"
Default "md"
Prop disabled
Type boolean
Default false
Prop required
Type boolean
Default false
Prop searchable
Type boolean
Default false
Prop searchPlaceholder
Type string
Default "Search..."
Prop name
Type string
Default β€”
Prop id
Type string
Default β€”
Prop onchange
Type (value: T) => void
Default β€”
Prop leading
Type Snippet
Default β€”
Prop trailing
Type Snippet
Default β€”
Prop palette
Type "tone" | "accent" | "accentbg"
Default "tone"
Prop rounded
Type boolean
Default false
Prop elevation
Type "none" | "subtle" | "hard"
Default "none"
Prop direction
Type "bottom" | "top" | "left" | "right"
Default "bottom"