@selkit/dom
v0.19.0
Published
Vanilla JS renderer for Selkit — DOM, events, a11y and default positioner.
Readme
@selkit/dom
Vanilla-JS renderer for Selkit — the
framework-agnostic select toolkit. Mounts a fully-featured select (search,
multiple, tagging, keyboard, a11y, dropdown positioning) on top of
@selkit/core, with no framework
required.
Install
pnpm add @selkit/dom @selkit/themesUsage
import { createSelkitDom } from '@selkit/dom'
import '@selkit/themes/base.css'
const instance = createSelkitDom(document.getElementById('host'), {
options: [
{ value: 'a', label: 'Apple' },
{ value: 'b', label: 'Banana' },
],
multiple: true,
placeholder: 'Pick fruits…',
})
instance.controller.on('change', ({ value }) => console.log(value))
// later
instance.destroy()It can also enhance an existing native <select>. See the
vanilla guide for enhancement
mode, dropdownParent, virtual scroll, templates and more.
Docs
📖 cluion.github.io/selkit · 繁體中文
