Skip to content

Select ​

Loading...

<flint-option> ​

An option element for use inside <flint-select>. Provides a declarative child-element API as an alternative to the options prop.

  • Tag: <flint-option>
  • Class: FlintOption

Import ​

ts
import '@getufy/flint-ui'; // auto-registers all
// or
import { FlintOption } from '@getufy/flint-ui';

Usage ​

html
<flint-option></flint-option>

Properties ​

PropertyAttributeTypeDefaultDescription
valuevaluestring''The machine-readable value for this option.
labellabelstring''Display label. If not set, the element's text content is used.
disableddisabledbooleanfalseWhether this option is disabled.
groupgroupstring''Optional group name. Options with the same group are rendered under a group header.

Slots ​

NameDescription
(default)Option label text. Falls back to the label prop if empty.

CSS Custom Properties ​

PropertyDefault
--flint-input-bg—
--flint-input-border-color—
--flint-input-border-radius—
--flint-primary-color—
--flint-error-color—
--flint-hover-color—
--flint-primary-color-light—
--flint-text-color-on-primary—
--flint-font-family—
--flint-label-color—
--flint-input-border-hover-color—
--flint-primary-focus-ring—
--flint-error-focus-ring—
--flint-input-disabled-bg—
--flint-input-readonly-bg—
--flint-input-placeholder-color—
--flint-text-color—
--flint-text-color-muted—
--flint-shadow-lg—
--flint-border-color—

<flint-select> ​

A select component for choosing one or multiple options from a list.

  • Tag: <flint-select>
  • Class: FlintSelect

Import ​

ts
import '@getufy/flint-ui'; // auto-registers all
// or
import { FlintSelect } from '@getufy/flint-ui';

Usage ​

html
<flint-select></flint-select>

Properties ​

PropertyAttributeTypeDefaultDescription
labellabelstring''Label text displayed above the select.
optionsoptionsSelectOption[][]Array of selectable options.
valuevaluestring | string[][]Current value (controlled). When set, the component reflects this value and does not manage its own state. Accepts a single string or an array of strings.
multiplemultiplebooleanfalseAllow multiple selections.
placeholderplaceholderstring''Placeholder text when no value is selected.
disableddisabledbooleanfalseDisables the select and prevents interaction.
readonlyreadonlybooleanfalseMakes the select read-only.
requiredrequiredbooleanfalseMarks the select as required for form validation.
errorerrorbooleanfalseWhether the select is in an error state.
errorMessageerror-messagestring''Error message displayed below the select.
namenamestring''Form field name used when submitting form data.
sizesizeSelectSize'md'Size variant of the select.
defaultValuedefault-valuestring''Initial value (uncontrolled). Only used on first render; ignored after mount. Single-select only.
hoisthoistbooleantrueWhen true, the dropdown uses position: fixed so it can escape
loadOptionsloadOptions((searchTerm?: string) =&gt; Promise&lt;SelectOption[]&gt;) | nullnullAsync options loader. When provided, called when the dropdown opens.
clearableclearablebooleanfalseWhen true, shows a clear button in the trigger when a value is selected.
searchablesearchablebooleanfalseWhen true, adds a text input for filtering options by label.
maxTagsVisiblemax-tags-visiblestringInfinityMaximum number of chips visible in multi-select mode.
virtualizevirtualizebooleanfalseEnable virtual scrolling for large option lists.
itemHeightitem-heightnumber36Fixed item height in px used for virtual scroll calculations.
visibleItemsvisible-itemsnumber8Maximum visible items in the dropdown (determines dropdown height).

Events ​

EventDetailDescription
flint-select-change&#123; value: string, multiple: false &#125; | &#123; value: string[], multiple: true &#125;Dispatched when the selection changes. detail: &#123; value: string, multiple: false &#125; | &#123; value: string[], multiple: true &#125;
flint-clear—Dispatched when the clear button is clicked.

Slots ​

NameDescription
iconOptional icon shown at the start of the trigger.
error-messageOptional slot for error message content (use error-message prop for simple text).

CSS Parts ​

NameDescription
labelThe &lt;label&gt; element.
triggerThe combobox trigger container.
placeholderThe placeholder text &lt;span&gt;.
chipA selected-value chip (multiple mode).
chip-overflowThe "+N more" overflow chip (multiple mode).
clear-buttonThe clear button (when clearable).
search-inputThe search input (when searchable).
dropdownThe dropdown listbox container.
optionAn individual option element.
error-messageThe error message &lt;span&gt;.

CSS Custom Properties ​

PropertyDefault
--flint-select-bg—
--flint-select-border—
--flint-select-radius—
--flint-select-focus-color—
--flint-select-error-color—
--flint-select-chip-bg—
--flint-select-chip-color—
--flint-select-chip-radius—
--flint-select-z-index1000
--flint-select-option-hover-bg—
--flint-select-option-selected-bg—
--flint-select-option-selected-color—