ColorInvertedSelector

A selector with inversion.

Example

Props

    đŸ•šī¸ standard props
    options
    Option[]
    Array of selectable options
    []
    selectedIndex
    number
    Index of the currently selected option
    undefined
    deletable
    boolean
    Determines if options can be deleted
    true
    class
    { container?: string, element?: string, selected?: string, }
    Custom class names for styling
    {}
    🎨 style props
    --color-inverted-selector-background-color
    color
    Background color of the selector
    rgb(var(--global-color-background-200))
    --color-inverted-selector-selected-background-color
    color
    Background color of the selected option
    rgb(var(--global-color-primary-400))
    --color-inverted-selector-selected-color
    color
    Text color of the selected option
    rgb(var(--global-color-grey-50))
    --color-inverted-selector-vertical-gap
    size
    Vertical gap between options
    8px
    --color-inverted-selector-icon-gap
    size
    Gap between the icon and the label
    8px
    --color-inverted-selector-selected-font-weight
    font-weight
    Font weight of the selected option
    700
    --color-inverted-selector-element-padding
    size
    Padding of each selectable element
    8px 8px 8px 16px
    --color-inverted-selector-element-border-radius
    size
    Border radius of each selectable element
    5px
    --color-inverted-selector-hover-background-color
    color
    Background color when hovering over an option
    rgb(var(--global-color-primary-500), .3)

Slots

    prependSnippet
    Renders content before the option label
    Default content:
    
    {#if !!option.icon}
      <Icon
        name={option.icon}
      ></Icon>
    {/if}
          
    Available variables:
    NameTypeDescription
    optionOptionThe current option
    indexnumberIndex of the current option
    handleClickClose(option: Option, index: number) => voidFunction to handle deletion
    optionSnippet
    Renders custom content for an option
    Default content:
    
    <div class="label">
      {option.label}
    </div>
          
    Available variables:
    NameTypeDescription
    optionOptionThe current option
    appendSnippet
    Renders content after the option label
    Default content:
    
    {#if deletable}
      <Icon
        name="mdi-close"
        onclick={() => handleClickClose(option, index)}
      ></Icon>
    {/if}
          
    Available variables:
    NameTypeDescription
    optionOptionThe current option
    handleClickClose(option: Option, index: number) => voidFunction to handle deletion

Events

    onselect
    Triggered when an option is selected
    AttributeTypeDescription
    optionOptionThe selected option
    selectedIndexnumber | undefinedIndex of the selected option
    nativeEventThe native event
    ondelete
    Triggered when an option is deleted
    AttributeTypeDescription
    optionOptionThe deleted option
    indexnumberIndex of the deleted option