Skip to content
Mizen UI
Docs

IntroductionInstallationCLIStylingFoundationsThemingCompositionIntegrationsAccessibilityFor agents

useCopyToClipboard

AccordionAspect RatioCardCollapsibleFrameGridGroupInlineScroll AreaSectionSeparatorSpacerStack

BlockquoteCitationCodeHeadingKbdLabelLinkTextVisually Hidden

ButtonButton GroupToggleToggle groupToolbar

CalendarCheckboxCheckbox groupComboboxDate pickerDate range pickerDate-Time InputFieldFieldsetFile UploadFormInputInput groupNumber fieldOTP FieldRadio groupSelectSliderSwitchTextareaTime Input

BreadcrumbMenubarNavigation MenuPaginationSegmented ControlStepperTabs

Alert dialogCommandContext MenuDialogDrawerMenuPopoverPreview CardSheetTooltip

AlertBadgeEmptyError StateMeterProgressSkeletonSpinnerStatus dotToast

Activity FeedAvatarAvatar GroupData TableListMetricOverflow ListProperty ListTableTokenTree

Area ChartBar ListCalendar HeatmapCategory ComparisonChart FrameChart LegendChart TooltipDistributionFunnelHeatmapMetric TrendPart-to-WholeProgress RingsRadar ChartRadial BarsSankey ChartScatter ChartScore GaugeTime Series

Diagram

AttachmentCarouselCode BlockLightboxMarkdownThumbnailTimestamp

Agent ThinkingApproval CardComposerConversationInline CitationMessageMessage ScrollerQuestion CardSourcesStreaming TextSuggestionTask ListTerminalTool Call

On this page

  • Preview
  • Usage
  • With the AI SDK
  • With TanStack AI
  • Examples
  • Document
  • Recommendations
  • Usage boundaries
  • API reference

Agentic

Inline Citation

A source in the sentence it supports: the site's favicon and name, opening the page. On hover or focus it previews the title and what the page says.

idle

Usage

import { InlineCitation } from "@mizen-labs/ui";

With the AI SDK

Each source-url part is a citation. In your own text, render a chip where the part appears; Streaming Text does this for [n] markers and { source } parts. title is optional; the chip falls back to the domain.

import { useChat } from "@ai-sdk/react";
import { InlineCitation, type InlineCitationSource, Text } from "@mizen-labs/ui";

// Render text parts as they come, and each source-url part as a chip where
// it appears in the reply.
export function CitedReply() {
	const { messages } = useChat();
	const reply = messages.findLast((message) => message.role === "assistant");
	return (
		<Text>
			{reply?.parts.map((part, index) => {
				if (part.type === "text") return part.text;
				if (part.type === "source-url") {
					const source: InlineCitationSource = { href: part.url, title: part.title };
					return <InlineCitation key={index} sources={[source]} />;
				}
				return null;
			})}
		</Text>
	);
}

With TanStack AI

TanStack AI has no source part. Have the model cite with [n] markers and pass the sources to Streaming Text, which turns each marker into a chip, or place chips yourself from your tool's results.

import { InlineCitation } from "@mizen-labs/ui";

export function Claim({ text, url, title }: { text: string; title: string; url: string }) {
	return (
		<>
			{text}
			<InlineCitation sources={[{ href: url, title }]} />
		</>
	);
}

Examples

Document

A file without a link shows its title, with nothing to open.

Recommendations

GuidancePractice
Do

Put the chip right after the claim it supports. Give sources a title and a one-line description, so the preview says what the page backs up.

Usage boundaries

GuidanceBoundary
Scope

The application decides what each claim cites. Inline Citation shows the source; it fetches only each site's favicon.

Scope

Streaming Text places citations for you. Use Inline Citation in your own text, such as Markdown or a summary.

API reference

Public props from @mizen-labs/ui. Use exported prop types for the complete TypeScript contract.

PropTypeDefaultDescription
sourcesreadonly { href?; title?; description?; icon? }[]—The sources behind this point. One source is a link with a preview on hover or focus; several show as one chip, such as web.dev +2, that opens a list. A document without href shows its title.
PreviousConversationNextMessage

Container queries style an element by the size of its container, where media queries look at the viewport.developer.mozilla.org, CSS container queries, opens in a new tab Every current browser supports them.

The design review asked for the card to switch layout at 400px.Q3 design review.pdf