Form Components

select-dropdown

Overview

The select-dropdown component is a dropdown that allows users to select an option from a list of options. This component is used in the scheduling form to input dropdown type inputs.

Version1.3.3
Install (React)npm install @nylas/react
Import (React)import { SelectDropdown } from '@nylas/react';
Import (CDN)<script type="module"> import { defineCustomElement } from "https://cdn.jsdelivr.net/npm/@nylas/web-elements@latest/dist/cdn/select-dropdown/select-dropdown.es.js"; defineCustomElement(); </script>

Properties

PropertyAttributeDescriptionTypeDefault
defaultSelectedOptionThe default selected optionDropdownOption | nullnull
dropdownButtonTextOverrides the select dropdown to be used as a button with dropdownButtonText representing actions & dropdownText name on the dropdown intead of selected valuestring | undefinedundefined
emptyValueAllows to set the empty value of the dropdownstring'Select an option'
errorMessageThe custom error message to display when the value is empty or null and the dropdown is requiredstring''
labelThe label for the dropdown, skipped if no label is providedstring | undefinedundefined
name _(required)_The name of the dropdownstringundefined
optionsThe options to display in the dropdownDropdownOption[][]
pluralizedLabelShow pluralized label for the selected option. This is s tring that is appended to the selected option label as a suffix.string''
requiredIf true, the dropdown is required for form submissionbooleanfalse
withChevronShould show chevron on buttonbooleantrue
withSearchShould show search inputbooleantrue

Events

EventDescriptionType
nylasFormDropdownChangedThis event is fired when the selected option is changedCustomEvent<{ value: string; name: string; error?: string | undefined; label?: string | undefined; }>
nylasFormDropdownDefaultSelectedThis event is fired when the default selected option is set, on component loadCustomEvent<{ value: string; name: string; error?: string | undefined; label?: string | undefined; }>

Shadow Parts

PartDescription
"sd_dropdown"The dropdown container
"sd_dropdown-button"The dropdown button
"sd_dropdown-button-selected-label"The selected option label
"sd_dropdown-content"The dropdown content
"sd_dropdown-labelhtml"
"sd_dropdown_label"The dropdown label

Built with StencilJS