Skip to content
Knowns UI
Get ProSign in

Related Links

The links of one item to others, for a side rail: blockers, related issues, docs that mention it. Rows show a status, a key and a title on a thin guide line, long groups fold behind Show N more, and your app brings the data and the add form.

On this page
Used for
  • Issue sidebar
  • Doc backlinks
  • Blockers and dependencies
  • Linked decisions

Examples

Rail

Nothing linked yet

A long list

In a 240px rail

When a blocker is done

This is the default pattern: when a blocker is done, move it from Blocked by to Related and mark it done, so Blocked by only holds open work and hides once it is empty. The component never moves links by itself; moveResolved does it for you before you pass the groups. The first demo does this: API-77 is done, so it sits under Related. Turn off Blocker done to see it back under Blocked by.

Heading and group labels

Keep the heading apart from the group labels. The default heading is Links, so a group can be called Related. A heading of Related over a group called Related gives two names that read the same, and a screen reader hears the same name twice. In development the component warns in the console when a group label equals the heading.

Installation

npx knowns-ui@latest add related-links
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

groups
{ id, label, tone?, items, limit? }[]
The groups in order. A group with no items is hidden.
groups[].tone
"default" | "attention" | "muted"
Default"default"
Attention for blockers (amber label and guide line), muted for done links.
items[]
{ id, title, href, key?, status?, statusLabel?, kind?, kindLabel?, done?, removeLabel?, removable? }
One row. status and kind are decorative slots; statusLabel and kindLabel are read out.
heading
ReactNode
Default"Links"
The heading over the groups.
headingLevel
2 | 3 | 4
Default3
Its level in your page.
action
ReactNode
End of the header, such as an Open in graph icon link.
limit
number
Default5
Rows per group before Show N more. One extra row never hides behind a button.
expanded / onExpandedChange
string[] / (ids) => void
Controlled ids of the groups that show every row.
onOpen
(item, group, e) => void
A row was clicked. Call e.preventDefault() to route in your app.
renderLink
(props) => ReactNode
Your router's link instead of an anchor; pass every prop through.
onRemove
(item, group) => void
Shows a remove button per row. Remove the item from groups; focus moves to the next row.
renderAdd
({ close }) => ReactNode
Your add form, opened by the Add link button. close() returns focus to the button.
addLabel
string
Default"Add link"
The add button's words.
addOpen / onAddOpenChange
boolean / (open) => void
Controlled open state of the add form.
items[].removable
boolean
Defaulttrue
False hides the remove button on that row, for links the viewer cannot remove: inbound links, text mentions. Only matters with onRemove.
footer
ReactNode
Under the groups: refs not found yet, a truncation note, a remove error. Shown even when every group is empty.
readOnly
boolean
Defaultfalse
No add button and no remove buttons. With nothing linked, nothing renders.
moveResolved
(groups, { from, to, isResolved }) => groups
Helper for the resolved pattern: moves resolved items to the top of another group, marked done.

Accessibility

  • The whole thing is a section named by its heading. Each group is a group named by its label, with its rows in a list.
  • Each row is one link, read as "key title, status, kind". The status glyph and kind icon are decorative, so the words come from statusLabel and kindLabel and nothing is read twice. Status is never told by colour alone.
  • Rows with removable false have no remove button at all, so the tab order skips nothing that does not work. The remove button follows its row in the tab order with its own name ("Remove API-77 from Blocked by"). It shows on hover and focus, and always on touch screens. After a removal, focus goes to the row that took its place, then the next group, then the add button.
  • Show N more and Add link are buttons with aria-expanded and aria-controls. Escape inside the add form closes it, and focus returns to Add link however the form closes.
  • Keep group labels different from the heading (the default heading is Links); the component warns in development when one is the same. Pick group labels that differ in their first word ("Blocked by", "Related"), not two near-identical ones: people scan the first word.

What it handles

  1. 01Groups links by relation, each with a label and a tone: blockers stand out in amber, done links fade a step. A group with no links is not shown.
  2. 02Draws each row as one link: the app's status glyph, the key, the title cut to fit, and a kind icon, on a thin guide line under the group label.
  3. 03Shows the first five rows of a long group and a Show N more button for the rest.
  4. 04Gives each row a remove button with a name of its own, or none on rows the viewer cannot remove, and moves focus to the next row once the app has removed it.
  5. 05Shows a footer under the groups for notes such as refs not found yet or a remove error, even with nothing linked.
  6. 06Opens the app's own add form under a quiet Add link button, and puts focus back on the button when the form closes.

States

First render
Nothing moves
none
Hover on a row
The row fills a step; the remove button fades in over the kind icon
120ms, ease out
Show N more
The rest of the rows fold open
180ms open, 120ms close, ease out
Add form
Appears under the button at once
none
Touch screen
Rows are 36px high and the remove button always shows
none
Reduced motion
Everything changes at once
0ms

Works with

When to use

When to use

  • The links of an issue, task or doc in its side rail: what blocks it, what it blocks, related items and backlinks.
  • A short list of linked items with a status and a key, where people add and remove links.

When not to use

  • One linked issue at the end of a row: use Issue Chip.
  • A full list of tasks grouped by status: use Grouped List.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Related Links to my app and wire it to my own data.
  • I need the links of an issue, task or doc in its side rail: what blocks it, what it blocks, related items and backlinks. Set that up with the Knowns UI Related Links.
  • Which Related Links props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "related-links" }) and search_docs({ query: "related links" }).

Need help?

Stuck on Related Links, or found something off? We read every message.