shadcn.io is not affiliated with official shadcn/ui
Cross Reference Comments Block for React
A thread whose composer reads #142-style numbers against an index of eight threads, flags unknown ones, and links posted references with a preview and a list of mentioned threads.
Installation
Overview
Connect discussions without leaving the box, with this linking composer for React with Base UI. A compact header names thread #160. The frame is a split: the thread and the composer first, a "Mentioned in this thread" list last. As you type, every number like #142 is read against a typed index of eight threads and shown under the Textarea with its title and state; a number that is not in the index is flagged ("No thread with this number") and stops the post with a sentence. Posted comments show each reference as a link that opens a Popover preview with the title, state, last activity and comment count. The side list is worked out from the comments and gains a row when you cite a new thread. It is built from Textarea, Popover, Badge, Field, Shine Button and Guides. For engineering wikis, trackers and any place threads refer to each other.
FAQ
How do I connect it to my threads?
Replace THREADS with your index (id, title, state, active and comments) or call your search from refsOf. References are found with one regular expression, REFERENCE; change it for another style such as PROJ-142.
What stays local, and how do I make it real?
Comments and links live in the page; nothing is sent. To make it real, save the comment from post, resolve the numbers on the server so a deleted thread cannot be linked, and store the link in both directions so the other thread can list "Mentioned in".
Why a popover and not a hover card?
A preview that opens on hover cannot be opened on a phone. The reference is a button: press or tap it, or use Enter, to open the preview, and Escape closes it.