GridSelectGridSelect
Guide
Reference
Demo
npm
GitHub
Guide
Reference
Demo
npm
GitHub
  • Getting started
  • How GridSelect works
  • Installation
  • Sources
  • Entries from a server
  • The panel
  • Search
  • Keyboard and digits
  • Groups
  • Pinned and recent entries
  • Descriptions
  • Multiple choice
  • Forms
  • Styling and themes
  • Accessibility
  • Custom element and frameworks

Installation

GridSelect has no dependencies. The package contains the core script, an optional custom element, a stylesheet, optional themes, and thin components for React and Vue. You only load the parts you use.

With npm and a bundler

Install the package:

npm install @emmgeede/gridselect

Then import the function and, if you want the ready-made look, the stylesheet. Bundlers such as Vite, webpack or esbuild handle the CSS import; in other setups link the file node_modules/@emmgeede/gridselect/src/gridselect.css yourself.

import { gridselect } from "@emmgeede/gridselect";
import "@emmgeede/gridselect/gridselect.css";

gridselect(document.querySelector("#currency"));

The package ships plain JavaScript modules with TypeScript declarations, so editors show the options and their types without any extra package.

From a CDN, without a build step

If your page has no build step, load the prebuilt files from a CDN. The script defines a global function gridselect on window. The @1 in the address always loads the newest 1.x version, which never contains breaking changes.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@emmgeede/gridselect@1/src/gridselect.css">
<script src="https://cdn.jsdelivr.net/npm/@emmgeede/gridselect@1/dist/gridselect.min.js"></script>
<script>
  document.querySelectorAll("[data-gridselect]").forEach((el) => gridselect(el));
</script>

If you would rather not call any JavaScript at all, load the build that contains the custom element instead. It registers the tag <grid-select>, which you then write directly in your HTML; see Custom element and frameworks.

<script src="https://cdn.jsdelivr.net/npm/@emmgeede/gridselect@1/dist/gridselect-element.min.js"></script>

Which file does what

ImportContents
@emmgeede/gridselectThe core function gridselect(). Everything on this site works with it.
@emmgeede/gridselect/elementThe custom element <grid-select>. Importing it registers the tag.
@emmgeede/gridselect/reactA React component around <grid-select>. Needs React 18 or newer.
@emmgeede/gridselect/vueA Vue 3 component around <grid-select>. Needs Vue 3.3 or newer.
@emmgeede/gridselect/gridselect.cssThe default stylesheet: light and dark mode, WCAG 2.2 AA contrast.
@emmgeede/gridselect/themes/*.cssOptional themes that you load after the stylesheet, see Styling and themes.

React and Vue are optional peer dependencies. Installing GridSelect never installs them; the components simply expect them to be present when you import them.

Size

The core script weighs about 9 kB minified and compressed with gzip, the core together with the custom element about 11 kB. The test suite checks both numbers on every change, so they cannot grow unnoticed.

Browser support

GridSelect supports the current versions of Chrome, Edge, Firefox and Safari, including their mobile versions. It uses modern but widely available features such as CSS layers, :has() and subgrid, and ElementInternals for the custom element as a form control. Older browsers are not supported, and there are no polyfills.

Edit this page
Last Updated: 11/10/26, 4:41 PM
Contributors: Michael Grossklos, Claude Opus 5.5