1.2.3 • Published 6 days ago

@frankhoodbs/combobox-cmp v1.2.3

Weekly downloads
-
License
ISC
Repository
-
Last release
6 days ago

Combobox Component

A flexible and accessible combobox component tailored for Vue 3. This combobox is designed for both visual appeal and usability, adhering to ARIA guidelines. The component is extensible, allowing for easy integration and customization of its design to match your project.

Version License

Generic types

  • T: The currently selected value from the combobox options. T can be of any type, based on the types of values you've provided within your options. Often, T will match the value type within the Option interface.

  • Option object must extend the following interface:

interface OptionItem {
  label: string;
  value: T;
  [key: string]: any;
}

This means that while every option object must have at least the value and label properties, it can also have additional properties.

Props

PropTypeDefaultDescription
model-valueT-The current value of the combobox
data-optionsOptionItem[]-Array of options for the combobox
data-id-prefixstring-required Prefix for all the id attributes
data-aria-labelledbystring-The ID of the element that labels the combobox
data-disabledbooleanfalseWhether the combobox is disabled or not
data-invalidbooleanfalseIf true, indicates the combobox's value is invalid
data-placement@floating-ui Placementbottom-startPlacement of the combobox list relative to the combobox
data-fallback-placements@floating-ui Placement[]-Array of alternative placements for the floating menu in case the desired placement is not possible
data-offsetnumber0Offset (in pixels) between the button and the floating menu

Events

EventPayload TypeDescription
'update:modelValue'TEmits the selected value from the combobox options

Slots

SlotPropsDescription
combobox{ label: string, expanded: boolean, option: OptionItem }Slot for customizing the combobox content
option{ option: OptionItem, index: number }Slot for customizing individual combobox options

CSS Custom Properties

Custom PropertyDefault ValueDescription
--combobox-cmp-combobox-backgroundtransparentBackground of the combobox
--combobox-cmp-combobox-colorblackText color of the combobox
--combobox-cmp-combobox-border-width0pxWidth of the combobox border
--combobox-cmp-combobox-border-colortransparentColor of the combobox border
--combobox-cmp-combobox-border-radius0pxBorder radius of the combobox
--combobox-cmp-disabled-opacity0.5Opacity of the combobox when disabled
--combobox-cmp-listbox-backgroundwhiteBackground of the combobox list
--combobox-cmp-listbox-colorblackText color of the combobox list
--combobox-cmp-listbox-border-width1pxWidth of the combobox list border
--combobox-cmp-listbox-border-colorblackColor of the combobox list border
--combobox-cmp-listbox-border-radius4pxBorder radius of the combobox list
--combobox-cmp-listbox-max-height200pxMaximum height of the combobox list
--combobox-cmp-option-active-backgroundgreyBackground of an active or hovered option
--combobox-cmp-option-selected-backgroundyellowBackground of a selected option
--combobox-cmp-transition-duration0.3sTransition duration
--combobox-cmp-transition-timing-functionease-in-outTransition timing function
--combobox-cmp-listbox-width100%Width of the combobox list
--combobox-cmp-listbox-min-width0Minimum width of the combobox list
--combobox-cmp-listbox-max-widthnoneMaximum width of the combobox list
--fh-color-outlineredOutline color for the active option
--fh-size-outline3pxOutline size for the active option
--fh-size-outline-offset1pxOutline offset size for the active option
1.2.3

6 days ago

1.2.2

19 days ago

1.2.1

22 days ago

1.2.0

23 days ago

1.1.21

23 days ago

1.1.16

2 months ago

1.1.15

2 months ago

1.1.14

2 months ago

1.1.19

2 months ago

1.1.18

2 months ago

1.1.20

2 months ago

1.1.13

2 months ago

1.1.12

3 months ago

1.1.11

3 months ago

1.1.10

4 months ago

1.1.9

4 months ago

1.1.8

4 months ago

1.1.7

4 months ago

1.1.6

4 months ago

1.1.1

4 months ago

1.1.3

4 months ago

1.1.2

4 months ago

1.0.10

7 months ago

1.0.9

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago