Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Similar Threads Comments Block for Solid

A question title box that finds similar threads as you type: ranked matches with shared words marked, an accepted answer to open, This answers it, and Still ask to post the question.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Stop duplicate questions before they are posted, with this similar-threads check for Solid with Ark UI. A compact header sits over one framed panel. A title Input starts with a question already typed. As you type, the words that matter (small words removed, plurals folded) are matched against six typed threads, and the best three appear under "Already asked" with a label (Strong match or Possible match), how many answers each has, and the shared words marked in the title. Open shows that thread's accepted answer in a reserved band, where This answers it clears the draft. The one primary, a Shine Button, is Still ask: it posts your question to the top of the recent questions list. The results area keeps room for three rows, and an Empty state names what you typed when nothing matches. It is built from Input, Badge, Button, Empty, Field, Shine Button and Guides, with a CSS entrance only. For forums, help centres and any form that asks a question.

FAQ

How are the matches ranked?

Both titles are cut into words, small words and very short ones are dropped, a trailing s is folded (runs and run match), and the threads are ranked by how many words they share, then by answers. A thread needs two shared words (one if your title has only one useful word). Four shared words, or every word of a short title, is a Strong match. The shared words are marked in each result.

Can I use search or embeddings instead?

Yes. Replace matchesOf(title, corpus) with a call to your search that returns the same list of { thread, shared, strength }. Keep marking what matched: it is what lets the asker judge a result at a glance. Debounce the call and keep the results area at a fixed height so typing never moves the form.

What stays local?

The six threads and your question. Still ask adds your title to the recent questions list in the page and says "Posted in this demo. Nothing was sent." To make it real, post the title (and a body field) from ask to your server, and link it to the thread a person said did not answer it.

What does it say when nothing matches?

An empty state: "Type your title" before you type anything, and "Nothing similar" with your own words quoted once you have. A title under ten characters cannot be posted: Still ask explains that in a problem line under the box.

Is it accessible?

Each Open button names its thread in hidden text and reports whether its answer is expanded. Matches are marked with a background as well as weight. The results are a labelled region and the status line reports opens, closes and posts.

How does it look on a phone?

Results stack at the full width, each with its Open button at the end of the title row; the answer band and the recent list keep their height and scroll inside their regions.