<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/introducing-rich-input-a-github-like-search-filter-text-input-to-embed-on-your-site-xmkcr6yt8" -->

---
title: Introducing <rich-input>, a GitHub-like search/filter...
description: A new open-source Web Component called <rich-input> replicates GitHub's structured search input, supporting free text mixed with key:value filters, dual...
canonical: https://daily.dev/posts/introducing-rich-input-a-github-like-search-filter-text-input-to-embed-on-your-site-xmkcr6yt8
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Introducing <rich-input>, a GitHub-like search/filter text input to embed on your site | daily.dev
og:description: A new open-source Web Component called <rich-input> replicates GitHub's structured search input, supporting free text mixed with key:value filters, dual...
og:url: https://daily.dev/posts/introducing-rich-input-a-github-like-search-filter-text-input-to-embed-on-your-site-xmkcr6yt8
og:image: https://api.daily.dev/og/posts/xmkcR6yt8.png
og:image:alt: Introducing <rich-input>, a GitHub-like search/filter text input to embed on your site
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Introducing <rich-input>, a GitHub-like search/filter text input to embed on your site

**[Bram.us](https://daily.dev/sources/bram)** · 8 min read · 1 upvotes · 0 comments

## Summary

A new open-source Web Component called <rich-input> replicates GitHub's structured search input, supporting free text mixed with key:value filters, dual autocompletion, rich option markup with images, validation with squiggly underlines, and native form participation. It's powered by the new OpaqueRange API (Chrome 152+), which lets developers get exact text-range coordinates and apply CSS Custom Highlights inside native inputs without mirror-div hacks. A contenteditable-based fallback covers browsers lacking OpaqueRange support. The component was built with AI assistance via Google Antigravity (Gemini), with the author sharing the full prompt and noting the AI added features like a clear button and keyboard navigation unprompted. Available via npm and jsDelivr CDN.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.bram.us/2026/09/14/introducing-rich-input-a-github-like-search-filter-text-input-to-embed-on-your-site>

## Questions this post answers

### What is the OpaqueRange API and what browser supports it?

OpaqueRange is a new native text input API available in Chrome 152+ that lets developers call input.createValueRange(start, end) to get a range representing a text slice inside a native input element. It enables getBoundingClientRect() for precise popover positioning and integrates with the CSS Custom Highlight API for styling substrings, eliminating the need for brittle 'mirror div' measurement hacks.

_Developers experimenting with new browser input APIs like this can track emerging web platform capabilities on daily.dev._

### How can I build a GitHub-style search input with autocomplete for keyword filters like label: or artist:?

A Web Component called rich-input provides this out of the box: it's configured declaratively by nesting HTML datalist elements inside it, giving dual autocompletion for both filter keywords and their values, full-string suggestion filtering, rich option markup with embedded images, validation with wavy underlines for invalid tokens, and native form participation via formAssociated.

_Anyone building structured search UIs can compare component approaches like this one on daily.dev._

### How does a web component handle rich text highlighting when the OpaqueRange API isn't supported in Firefox or Safari?

When OpaqueRange isn't available, the component swaps its native input for a single-line contenteditable element inside the Shadow DOM and falls back to regular CSS Custom Highlights for styling. Because Custom Highlights don't cross into Shadow DOM in Firefox and Safari, the component copies the document's custom highlight stylesheets into the Shadow DOM to fix that gap.

_Developers dealing with cross-browser Shadow DOM styling quirks can find similar workarounds discussed on daily.dev._

## Similar posts on daily.dev

- [<calc-input>, a custom input element that accepts mathematical formulas](https://daily.dev/posts/calc-input-a-custom-input-element-that-accepts-mathematical-formulas-pippkdutq) · Bram.us · 3 upvotes · 0 comments
- [Fine, I’ll build my own text editor](https://daily.dev/posts/fine-i-ll-build-my-own-text-editor-mlxtdf0rd) · Lobsters · 0 upvotes · 0 comments
- [From HTML to Structured Content: Why We Built the Modern Rich Text Editor](https://daily.dev/posts/from-html-to-structured-content-why-we-built-the-modern-rich-text-editor-fpapzaf8a) · Syncfusion · 0 upvotes · 0 comments
- [Wiggly/Wavy Input Range Slider](https://daily.dev/posts/wiggly-wavy-input-range-slider-3yabli90t) · CSS Tip · 40 upvotes · 2 comments
- [7 Game-Changing Web UI Features You Can Start Using Today](https://daily.dev/posts/7-game-changing-web-ui-features-you-can-start-using-today-lanxczirv) · Amit Merchant · 6 upvotes · 0 comments

---

Tags: [#google-antigravity](https://daily.dev/tags/google-antigravity), [#web-components](https://daily.dev/tags/web-components), [#webdev](https://daily.dev/tags/webdev)

[View this post on daily.dev](https://daily.dev/posts/introducing-rich-input-a-github-like-search-filter-text-input-to-embed-on-your-site-xmkcr6yt8)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Introducing \u003crich-input\u003e, a GitHub-like search/filter text input to embed on your site","url":"https://daily.dev/posts/introducing-rich-input-a-github-like-search-filter-text-input-to-embed-on-your-site-xmkcr6yt8","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/introducing-rich-input-a-github-like-search-filter-text-input-to-embed-on-your-site-xmkcr6yt8"},"datePublished":"2026-09-14T21:42:49.629Z","dateModified":"2026-11-12T02:16:00.662Z","description":"A new open-source Web Component called \u003crich-input\u003e replicates GitHub's structured search input, supporting free text mixed with key:value filters, dual...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a3e37f83b0f177b5a49cd51a76637601?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a3e37f83b0f177b5a49cd51a76637601?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Bram.us","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Bram.us","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/3db2116954be44df873ec24cf0e03d14","url":"https://daily.dev/sources/bram"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/introducing-rich-input-a-github-like-search-filter-text-input-to-embed-on-your-site-xmkcr6yt8","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"google-antigravity,web-components,webdev","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Bram.us","item":"https://daily.dev/sources/bram"},{"@type":"ListItem","position":3,"name":"Introducing \u003crich-input\u003e, a GitHub-like search/filter text input to embed on your site"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/introducing-rich-input-a-github-like-search-filter-text-input-to-embed-on-your-site-xmkcr6yt8#faq","mainEntity":[{"@type":"Question","name":"What is the OpaqueRange API and what browser supports it?","acceptedAnswer":{"@type":"Answer","text":"OpaqueRange is a new native text input API available in Chrome 152+ that lets developers call input.createValueRange(start, end) to get a range representing a text slice inside a native input element. It enables getBoundingClientRect() for precise popover positioning and integrates with the CSS Custom Highlight API for styling substrings, eliminating the need for brittle 'mirror div' measurement hacks. Developers experimenting with new browser input APIs like this can track emerging web platform capabilities on daily.dev."}},{"@type":"Question","name":"How can I build a GitHub-style search input with autocomplete for keyword filters like label: or artist:?","acceptedAnswer":{"@type":"Answer","text":"A Web Component called rich-input provides this out of the box: it's configured declaratively by nesting HTML datalist elements inside it, giving dual autocompletion for both filter keywords and their values, full-string suggestion filtering, rich option markup with embedded images, validation with wavy underlines for invalid tokens, and native form participation via formAssociated. Anyone building structured search UIs can compare component approaches like this one on daily.dev."}},{"@type":"Question","name":"How does a web component handle rich text highlighting when the OpaqueRange API isn't supported in Firefox or Safari?","acceptedAnswer":{"@type":"Answer","text":"When OpaqueRange isn't available, the component swaps its native input for a single-line contenteditable element inside the Shadow DOM and falls back to regular CSS Custom Highlights for styling. Because Custom Highlights don't cross into Shadow DOM in Firefox and Safari, the component copies the document's custom highlight stylesheets into the Shadow DOM to fix that gap. Developers dealing with cross-browser Shadow DOM styling quirks can find similar workarounds discussed on daily.dev."}}]}
```

