Skip to content

CSS Showcase · Live Demo

Type ahead, pick fast.

The native datalist combobox beside a custom suggestion list with highlighted matches — autocomplete, two ways, no dependency.

Featured demo

mobile · touch-suggest

Matches highlight as you type.

mobile design patterns

combobox-touch-suggest.css
/* Touch suggestions */
.touch-combo {
  display: grid;
  gap: 0.6rem;
}

.touch-combo input {
  block-size: 3.25rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--card);
  padding: 0 1rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.touch-combo [role="listbox"] {
  display: grid;
  gap: 0.4rem;
  max-block-size: 16rem;
  overflow: auto;
}

.touch-combo [role="option"] {
  min-block-size: 3rem;
  display: flex;
  align-items: center;
  text-align: start;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--card);
  padding: 0 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.1s ease, border-color 0.1s ease;
}

.touch-combo [role="option"]:hover {
  background: var(--accent);
  border-color: var(--ring);
}

.touch-combo mark {
  background: color-mix(in srgb, var(--primary) 22%, transparent);
  color: inherit;
  border-radius: 0.2rem;
}

CSS features used

  • • datalist + list attribute
  • • role=listbox / option
  • • aria-expanded / aria-controls
  • • color-mix() highlight
  • • position: absolute popover
  • • Semantic tokens

CSS Showcase · Share

Share this demo as a 1:1 image

A 2048×2048 PNG with the live current view, the title, and the CSS features — for social posts, docs, and READMEs.

The snapshot follows the device selected on the page — switch between desktop, iPad, and mobile above and the card updates.