<select>
elements better, by adding features like type to search, multi-select, and customizable styling and templates.
The current version of Better Select is an extreme proof of concept. There are still quite a few features to be added.
<head>
of your document.
<select>
element in a <better-select>
tag.
multiple
attribute to the <select>
element.
data-item
attribute of the <option>
element.
item.key
to access the data in the templates. You can use data-text
, data-src
, or data-href
to set properties.
<template data-for="item">
to specify the template for the dropdown items and <template data-for="pill">
to specify the template for the selected pills.
data-url
attribute on the <select>
element.
{query}
, which will be replaced with the current search query.
value
and name
property.