wunderui.com/components/tabs
Arrow keys move focus between tabs. Home and End jump to the first and last tab. Only the selected tab is in the tab sequence.
Cookie settings
Your license after an unlock and your light or dark mode are stored because the site needs them. Google Analytics is optional: it only runs if you accept, and you can change your choice at any time under Cookie settings in the footer. Privacy policy
The numbered sources of an answer, with an icon per kind of source, a line of detail and links that open in a new tab. The numbers match the citations in the text.
Source List comes with WunderUI Core and Pro, in the package from your plan. See the plans.
Then import what you need:
import { SourceList } from "@wunderui/react"Then use it:
import { SourceList } from "@wunderui/react"
const sources = [
{ title: "q3-report.pdf", meta: "File · 2.4 MB", kind: "file" },
{ title: "Pricing, WunderUI", meta: "wunderui.com · web page", kind: "web", href: "https://wunderui.com/pricing" },
] as const
export function Sources() {
return <SourceList id="answer-sources" sources={[...sources]} />
}Expected result: You see a card titled Sources with 2 pinned and two numbered rows. The second row is a link.
A source with an http(s) or relative link opens in a new tab. Any other address, such as file:, mailto: or javascript:, is shown as plain text.
The list grows with the array and counts the rows it shows. It has no limit and no empty state of its own.
Pass a title to name the list. The count on the right is fixed text, N pinned.
Titles and detail lines wrap onto more lines inside the card and never run out of it.
countLabel replaces the word after the count and an empty string hides it. highlight marks the source a citation points at. Each row has an id (id-1, id-2) so a citation can scroll to it.
Only the rows that are links take part. The list itself handles no keys.
What the list does with numbers, links, text and assistive technology.
The parts the component is made of. Each one renders a you can target from CSS.
A section with a 1 px border and a 16 px radius, named by the title when it is a string, otherwise Sources. It is as wide as its container.
The title in 14 px semibold, Sources by default.
N pinned, the number of rows drawn, in 12 px tertiary text. replaces the word and an empty string hides the count.
One item of an ordered list with a hairline above it. With a list id each row gets that id plus its number, and a source with an http(s) or relative link is an anchor, any other a span.
A 20 px indigo tint circle with the place of the source in the array, starting at 1. A citation points to this number.
A decorative 16 px Lucide icon by kind: a globe for web (the default), a file, a document or a channel. There is no favicon.
The title in 14 px medium and an optional meta line in 12 px secondary text, for the domain, size or editor. Both wrap.
Number citations from the same array. Link citation 2 to the row with id answer-sources-2, so both numbers cannot drift apart.
Put the domain, size or editor in the meta line. There is no favicon, so the line under the title is where a person sees where a source comes from.
Pass a link only for http(s) and relative addresses. Anything else, such as file, mailto, javascript or data, is drawn as a plain row, so a source from the open web cannot run code.
Cut a long list yourself. Slice the array from the start so numbers still match the citations, and add a button saying how many are hidden, like Show 3 more.
Draw the list only when there is something to list. Say No sources were used for this answer or show skeleton rows while sources are looked up.
Don't pass an empty array. The list draws its header with 0 pinned and nothing else.
Don't reorder the array after the answer was written. The numbers in the text are places in the array.
Don't use a long sentence as the title. It sits beside the count on one row and wraps, so keep it to a word or two.
SourceList is a plain component, so the table lists every prop. A source has a title, and optionally a meta line, a kind and a link.
A section with a 1 px border and a 16 px radius, named by the title when it is a string, otherwise Sources. It is as wide as its container.
| Prop | Type | Default | Description |
|---|---|---|---|
| sources required | Source[] | — | The sources, in order. Each has a , an optional line, an optional (, , or , default ) and an optional . The place in the array is the number. |
| title | ReactNode | "Sources" | The heading of the list. Default . When it is a string it also names the section for assistive technology. |
| id | string | — | Gives the rows ids: , and so on, for citations to link to. Without it the rows have no id. |
| className | string | — | Extra classes for the list, for example a maximum width. |
| countLabel | string | "pinned" | The word after the count in the header ("3 pinned"). Pass an empty string to hide the count. |
| highlight | number | — | 1-based number of the source a citation points at right now. It gets a subtle fill and . |
Give your coding assistant the Markdown reference instead of screenshots.
get_component("source-list")The full library index for assistants is at /llms.txt.
wunderui.com/components/tabs
94% matchArrow keys move focus between tabs. Home and End jump to the first and last tab. Only the selected tab is in the tab sequence.
1export function UsageSummary() {2return (3<div className="rounded-xl border border-border bg-card p-4">4<p className="text-sm text-text-secondary">Requests this month</p>5<p className="text-2xl font-semibold">1,842</p>6<p className="text-sm text-text-secondary">Cost $69.98</p>7<p className="text-xs text-text-tertiary">Up 12% on last month</p>8</div>9)10}