### Install Slim Select via npm Source: https://github.com/brianvoe/slim-select/blob/master/README.md Use npm to install the Slim Select library. This is the recommended method for Node.js projects. ```bash npm install slim-select ``` -------------------------------- ### Vue Integration Source: https://github.com/brianvoe/slim-select/blob/master/README.md Instructions and example for using SlimSelect with Vue 3, including installation and basic usage. ```APIDOC ## Vue Integration ### Description Utilize SlimSelect within Vue 3 applications with official component support, ensuring full reactivity. ### Installation ```bash npm install slim-select ``` ### Usage ```vue ``` ``` -------------------------------- ### SlimSelect Initialization with Settings Source: https://github.com/brianvoe/slim-select/blob/master/README.md Demonstrates how to initialize SlimSelect with various configuration settings to customize its behavior and appearance. ```APIDOC ## SlimSelect Initialization with Settings ### Description Initialize SlimSelect with custom settings to control its behavior, such as search functionality, accessibility, and display options. ### Method `new SlimSelect(options)` ### Parameters #### Settings Object - **select** (string | HTMLElement) - Required - The CSS selector or HTML element for the select input. - **settings** (object) - Optional - An object containing configuration options. - **disabled** (boolean) - `false` - Disable the select. - **alwaysOpen** (boolean) - `false` - Keep dropdown always open. - **showSearch** (boolean) - `true` - Show search input. - **focusSearch** (boolean) - `true` - Auto focus search on open. - **keepSearch** (boolean) - `false` - Keep search input value when dropdown closes. - **ariaLabel** (string) - `'Combobox'` - ARIA label for accessibility. - **searchPlaceholder** (string) - `'Search'` - Search input placeholder. - **searchText** (string) - `'No Results'` - Text when no results found. - **searchingText** (string) - `'Searching...'` - Text while searching. - **searchHighlight** (boolean) - `false` - Highlight search terms. - **closeOnSelect** (boolean) - `true` - Close dropdown after selection. - **contentLocation** (HTMLElement) - `document.body` - Where to append dropdown. - **contentPosition** (string) - `'absolute'` - CSS position: absolute, relative, fixed. - **contentWidth** (string) - `''` - Content width: "500px" exact, ">500px" min-width, "<500px" max-width. - **openPosition** (string) - `'auto'` - Open direction: auto, up, down. - **placeholderText** (string) - `'Select Value'` - Placeholder text. - **allowDeselect** (boolean) - `false` - Allow deselecting in single select. - **hideSelected** (boolean) - `false` - Hide selected options in dropdown. - **keepOrder** (boolean) - `false` - Keep user click order (not DOM order) for getSelected. - **showOptionTooltips** (boolean) - `false` - Show tooltips on options. - **minSelected** (number) - `0` - Minimum selections (multi-select). - **maxSelected** (number) - `1000` - Maximum selections (multi-select). - **timeoutDelay** (number) - `200` - Delay for callbacks (ms). - **maxValuesShown** (number) - `20` - Max values shown before message. - **maxValuesMessage** (string) - `'{number} selected'` - Message when max values exceeded. - **addableText** (string) - `'Press "Enter" to add {value}'` - Text for addable option. ### Request Example ```javascript new SlimSelect({ select: '#selectElement', settings: { showSearch: true, placeholderText: 'Choose an option', allowDeselect: true } }) ``` ``` -------------------------------- ### Basic Slim Select Initialization Source: https://github.com/brianvoe/slim-select/blob/master/README.md Initialize Slim Select with a basic configuration targeting a select element. Optional CSS imports are shown. ```javascript import SlimSelect from 'slim-select' import 'slim-select/styles' // optional css import method import 'slim-select/scss' // optional scss import method new SlimSelect({ select: '#selectElement' }) ``` ```html ``` -------------------------------- ### Slim Select Initialization with Data Source: https://github.com/brianvoe/slim-select/blob/master/README.md Initialize Slim Select by providing data as an array of objects. Supports both simple options and optgroups. ```javascript new SlimSelect({ select: '#selectElement', // Array of Option objects data: [{ text: 'Value 1', value: 'value1' }], // or // Array of Optgroups and/or Options data: [{ label: 'Optgroup Label', options: { text: 'Value 1', value: 'value1' } }] }) ``` -------------------------------- ### SlimSelect Methods Source: https://github.com/brianvoe/slim-select/blob/master/README.md Provides methods for programmatic control over a SlimSelect instance after initialization. ```APIDOC ## SlimSelect Methods ### Description Control and interact with a SlimSelect instance programmatically using its available methods. ### Usage First, get an instance of SlimSelect: ```javascript const slim = new SlimSelect({ select: '#selectElement' }) ``` ### Methods - **enable()**: Enables the select element. - **disable()**: Disables the select element. - **getData()**: Gets the current data array of the select. - Returns: `Array