<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: compsult</title>
    <description>The latest articles on DEV Community by compsult (@compsult).</description>
    <link>https://dev.to/compsult</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3763118%2F37a2fc0d-36d4-42ea-9dbf-276a8eeddf06.png</url>
      <title>DEV Community: compsult</title>
      <link>https://dev.to/compsult</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/compsult"/>
    <language>en</language>
    <item>
      <title>I built a picker widget that works with one line of code</title>
      <dc:creator>compsult</dc:creator>
      <pubDate>Tue, 10 Feb 2026 01:29:35 +0000</pubDate>
      <link>https://dev.to/compsult/i-built-a-picker-widget-that-works-with-one-line-of-code-3h3c</link>
      <guid>https://dev.to/compsult/i-built-a-picker-widget-that-works-with-one-line-of-code-3h3c</guid>
      <description>&lt;p&gt;I kept running into the same problem: HTML  elements are ugly, hard to style, and painful on mobile. Custom dropdown libraries are either React-only or require a ton of configuration.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://github.com/compsult/Quickpick-ui" rel="noopener noreferrer"&gt;https://github.com/compsult/Quickpick-ui&lt;/a&gt; — a picker that works as a React component or a vanilla JS one-liner.&lt;/p&gt;

&lt;p&gt;The simplest possible API&lt;/p&gt;



&lt;p&gt;&amp;lt;br&amp;gt;
    Quickpick(&amp;amp;#39;#picker&amp;amp;#39;, [&amp;amp;#39;January&amp;amp;#39;, &amp;amp;#39;February&amp;amp;#39;, &amp;amp;#39;March&amp;amp;#39;, &amp;amp;#39;April&amp;amp;#39;,&amp;lt;br&amp;gt;
      &amp;amp;#39;May&amp;amp;#39;, &amp;amp;#39;June&amp;amp;#39;, &amp;amp;#39;July&amp;amp;#39;, &amp;amp;#39;August&amp;amp;#39;, &amp;amp;#39;September&amp;amp;#39;, &amp;amp;#39;October&amp;amp;#39;,&amp;lt;br&amp;gt;
      &amp;amp;#39;November&amp;amp;#39;, &amp;amp;#39;December&amp;amp;#39;]);&amp;lt;br&amp;gt;
  &lt;/p&gt;

&lt;p&gt;That's it. No build step, no config files, no CSS imports.&lt;/p&gt;

&lt;p&gt;It adapts to the device&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Desktop: hover to open, type to filter the grid instantly, Enter selects the first match&lt;/li&gt;
&lt;li&gt;Mobile: tap to open, large touch targets, tap backdrop to close&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I didn't want two separate code paths for this. The widget detects hover: none via media query and switches behavior automatically.&lt;/p&gt;

&lt;p&gt;Type to filter is the killer feature&lt;/p&gt;

&lt;p&gt;With a long list (say, all 50 US states), you don't want to scroll through a grid. Just start typing "new" and you instantly see New Hampshire, New Jersey, New Mexico, and New York. Enter selects the&lt;br&gt;
  first match.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://compsult.github.io/Quickpick-ui/" rel="noopener noreferrer"&gt;https://compsult.github.io/Quickpick-ui/&lt;/a&gt; — the 50 states demo is the best way to see this in action.&lt;/p&gt;

&lt;p&gt;Works as a React component too&lt;/p&gt;

&lt;p&gt;import { AppointmentTimeSelector } from './components';&lt;/p&gt;

&lt;p&gt;
    items={[&lt;br&gt;
      { value: 'CA', label: 'California' },&lt;br&gt;
      { value: 'NY', label: 'New York' },&lt;br&gt;
      { value: 'TX', label: 'Texas' },&lt;br&gt;
    ]}&lt;br&gt;
    selectedValue={selected}&lt;br&gt;
    onTimeChange={(item) =&amp;gt; setSelected(item.value)}&lt;br&gt;
    placeholder="Choose a state"&lt;br&gt;
    label="US State"&lt;br&gt;
  /&amp;gt;&lt;/p&gt;

&lt;p&gt;There's also a BusinessHoursTimeSelector for dual start/end time pickers, and a loading prop that shows a shimmer skeleton while you fetch data.&lt;/p&gt;

&lt;p&gt;What's under the hood&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web Components with Shadow DOM for the vanilla JS build&lt;/li&gt;
&lt;li&gt;Full keyboard navigation (arrows, Home/End, Tab, Escape)&lt;/li&gt;
&lt;li&gt;role="listbox" / role="option" with aria-selected for screen readers&lt;/li&gt;
&lt;li&gt;Auto-positioning (flips above/below based on viewport space)&lt;/li&gt;
&lt;li&gt;prefers-reduced-motion support&lt;/li&gt;
&lt;li&gt;128 tests&lt;/li&gt;
&lt;li&gt;MIT licensed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Links&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Live demo: &lt;a href="https://compsult.github.io/Quickpick-ui/" rel="noopener noreferrer"&gt;https://compsult.github.io/Quickpick-ui/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/compsult/Quickpick-ui" rel="noopener noreferrer"&gt;https://github.com/compsult/Quickpick-ui&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd love feedback — especially on the API design. Is the Quickpick('#el', data) pattern intuitive enough? Anything you'd want added?&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
