Open Source · MIT License · v0.2.0
Forge Select is a zero-dependency, accessible, high-performance replacement for Select2 — rich items, automatic virtualization for huge lists, tags, AJAX, tree select, drag-and-drop tag ordering, i18n, and a plugin architecture.
import ForgeSelect from "forge-select";
import "forge-select/styles.css";
const select = new ForgeSelect("#country", {
placeholder: "Select a country",
searchable: true,
clearable: true,
});
select.on("change", (value) => console.log(value));
No jQuery. No CSS fights. No performance cliffs.
Lists over 100 rows virtualize automatically — 1,000 rich items keep only ~11 rows in the DOM, and rendered rows are cached per option.
Built-in avatar and description fields render avatar + label + subtext layouts with zero templates — and they're XSS-safe.
Styling is driven entirely by CSS variables. A dark theme ships out of the box; custom templates give you full HTML control.
ARIA combobox/listbox semantics, aria-activedescendant, and complete keyboard navigation are built in, not bolted on.
Multiple selection with removable, drag-to-reorder tags, and allowCreate to add options from free text.
Debounced AJAX loading with a transform hook, stale-response guarding, and optional infinite-scroll pagination.
Nested children with expand/collapse and cascading multi-select — purely additive on top of flat lists.
Extend behavior with lifecycle hooks (onInit, onOpen, onClose, onDestroy) instead of forking the core.
Written in strict TypeScript, ships ESM + CJS + IIFE bundles with type declarations. Works with every framework.
There's a full option/event/method mapping table and a step-by-step checklist.
Read the migration guideForge Select is a drop-in-concept replacement, not a byte-for-byte API clone: it covers Select2's core ideas (searchable dropdowns, tags, AJAX, templates) with a smaller, framework-agnostic API. See the Migration from Select2 guide for the full option/event/method mapping.
No. Forge Select has zero runtime dependencies — it's written in strict TypeScript and ships ESM, CJS, and IIFE bundles with type declarations, so it works with any framework or none.
Yes. Lists over 100 rows virtualize automatically — rendering only the visible rows plus a small buffer — and rendered row content is cached per option, so lists with thousands of items stay fast.
Yes. Forge Select implements ARIA combobox/listbox semantics, aria-activedescendant, and full keyboard navigation out of the box.
Forge Select is framework-agnostic vanilla JavaScript/TypeScript, so it can be mounted inside any framework today. Official wrapper packages are available for React (forge-select-react) and Vue (forge-select-vue) with controlled value/v-model support; Angular and Svelte wrappers are on the roadmap.
Yes. Set sortable: true on a multiple select to let users drag tags into a new order with mouse, touch, or pen, or use Alt+Left/Alt+Right when a tag has keyboard focus.
Forge Select is pre-1.0 (currently 0.2.0). The core API — options, methods, and events — is functional and tested, but the API may still change before a stable 1.0 release.