2.0.2 • Published 2 months ago

@frankhoodbs/combobox-cmp v2.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 months 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
2.0.2

2 months ago

2.0.1

2 months ago

1.2.12

2 months ago

1.2.11

2 months ago

1.2.9

4 months ago

1.2.10

4 months ago

1.2.8

6 months ago

1.2.7

6 months ago

1.2.4

6 months ago

1.2.3

6 months ago

1.2.2

7 months ago

1.2.1

7 months ago

1.2.0

7 months ago

1.1.21

7 months ago

1.1.16

8 months ago

1.1.15

8 months ago

1.1.14

8 months ago

1.1.19

8 months ago

1.1.18

8 months ago

1.1.20

8 months ago

1.1.13

8 months ago

1.1.12

9 months ago

1.1.11

9 months ago

1.1.10

10 months ago

1.1.9

10 months ago

1.1.8

10 months ago

1.1.7

10 months ago

1.1.6

10 months ago

1.1.1

10 months ago

1.1.3

10 months ago

1.1.2

10 months ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago