nextui.dev
Home
Docs
Saved
Pricing
Components37
  • Forms & inputs7
  • Cards13
  • Buttons, badges & avatars8
  • Feedback & display6
  • Effects3
Agents17
  • Chat inputNew
  • Task checklistNew
  • ReasoningNew
  • Tool callNew
  • Tool approvalNew
  • SourcesNew
  • Agent timelineNew
  • Artifact panelNew
  • Streaming messageNew
  • Conversation shellNew
  • Voice agentNew
  • Voice orbNew
  • Thinking ring
  • Thinking waveNew
  • Thinking sparkle
  • Thinking bot
  • Prompt deckNew
Blocks20
  • Agent chatNew
  • Pill heroNew
  • Grid hero
  • Moodboard generatorNew
  • Waitlist heroNew
  • Intro bannerNew
  • Creative home heroNew
  • Chat heroNew
  • App shelfNew
  • Usage card
  • Design resultsNew
  • Pricing tiers
  • Dashboard home
  • The shiftNew
  • Launch perksNew
  • Testimonials
  • Quote
  • Team
  • Leads tableNew
  • Sign in
Pages10
  • ASCII workspace$49
  • CRM overviewNew
  • Marketing dashboardNew
  • Developer portfolio$49
  • Particle landing$49
  • Particle story$49
  • Statement converter$49
  • AI photo studio$49
  • Group card launch$49
  • Month-end storyNew
Themes9
  • Default
  • Ember
  • Ocean
  • Forest
  • Grape
  • Rose
  • Amber
  • Clay
  • Brutal
Upgrade
nextui.dev

nextui components, blocks and themes you install with one command.

Product

  • Components
  • Blocks
  • Themes
  • Pricing

Resources

  • Docs
  • Roadmap
  • GitHub

Legal

  • License
  • Privacy
  • Terms
  • Refunds

nextUI

[ 200 OK ] · nextUI

© 2026 NEXTUI • All rights reserved.

Upgrade
ComponentsAI & agentsSources
Copy promptCopy prompt

Customize

Answer text; markers like [1] or [2][3] become citation chips

Text of the list toggle

Start with the source list open

Stream the answer and open the list on a loop, for demos

JSX · copied with Copy prompt

<Sources autoPlay />

SourcesNew

Agent answer with inline citation chips that show the source on hover, and a collapsible list of the sources behind it. Reads [1]-style markers and AI SDK source-url parts.

Installation

Set your access key from API keys as NEXTUI_TOKEN in .env.local and add the @nextui namespace below to components.json once. Then every item installs by name. Each install counts as a copy on a free account.

$pnpm dlx shadcn@latest add @nextui/sources
1{
2 "registries": {
3 "@nextui": {
4 "url": "https://nextui.dev/r/{name}.json",
5 "headers": { "Authorization": "Bearer ${NEXTUI_TOKEN}" }
6 }
7 }
8}

Usage

1"use client";
2
3import type { UIMessage } from "ai";
4import { Sources } from "@/components/nextui/sources";
5
6// Ask the model to cite with [1], [2] markers in the order of the sources it used.
7// On the server, send sources with toUIMessageStreamResponse({ sendSources: true }).
8export function AssistantMessage({ message }: { message: UIMessage }) {
9 const text = message.parts.flatMap((p) => (p.type === "text" ? [p.text] : [])).join("");
10 const sources = message.parts.flatMap((p) =>
11 p.type === "source-url" ? [{ url: p.url, title: p.title }] : [],
12 );
13
14 return <Sources answer={text} sources={sources} />;
15}

API reference

Edit props live in the preview above, or see all 8 props
PropTypeDefaultDescription
answerstring–Answer text; markers like [1] or [2][3] become citation chips
sources{ url: string; title?: string; snippet?: string }[]–Sources in citation order: [1] is the first one
labelstring"N sources"Text of the list toggle
defaultOpenbooleanfalseStart with the source list open
openboolean–Controlled open state of the list
onOpenChange(open: boolean) => void–Called when the list opens or closes
autoPlaybooleanfalseStream the answer and open the list on a loop, for demos
classNamestring–Extra classes on the wrapper

Related

All components

Chat inputNew

Task checklistNew

ReasoningNew

Sign in to see the code

Preview it freely. A free account copies code and prompts a few times a day.

Sign in