{{#extend "layout-docs"}} {{#replace "pageTitle"}}Select{{/replace}} {{#replace "main"}}

Select

{{#each select}}
{{> select}}
{{> select-src}}
{{/each}}

Introduction

A default <select> element that can be enhanced with JavaScript to allow for both custom styling and an input bar to filter options.

Source files

Markup
src/html/components/select.hbs
Styling
src/styles/components/elements/_select.scss
Script
src/scripts/modules/jquery.pfSelect.js

Usage

JavaScript hooks/values Effect Required
data-js=enhance-select Placed on any select that you want to be enhanced with custom styling. Optional
data-select-filter=true Placed on any [data-js=enhance-select] element to include a filter input bar. Optional
data-select-filter=true Placed on any [data-js=enhance-select] element to include a filter input bar. Optional
data-display=[DISPLAY-TEXT] Placed on any option element where you want the selected text to be different to the text shown in the dropdown. Optional
.enhanced-select--box When placed on the select element will render a boxed select element. Optional
[disabled] Adding this attribute to the select will disable the select and add a .enhanded-select--disabled class to the wrapper. Optional
{{/replace}} {{/extend}}