Skip to content
Sign in
ConversationFollow-upsMenu

Follow-ups

Related questions after an answer: hairline rows that send on click, a compact chip layout, one tab stop with arrow key navigation, and a streaming state where rows append in place.

Rows under an answer. Choosing one sends it as the next turn.

Installation

$ pnpm dlx shadcn@latest add https://chatcn.dev/r/follow-ups.json

Usage

tsx
import { FollowUps } from "@/components/ui/chatcn/follow-ups"

<FollowUps items={related} onSelect={(text) => sendMessage({ text })} />

Show follow-ups only once the answer has finished, and send on click: a row that promises a question should ask it. For starter prompts that fill the composer instead, use Suggestions.

Examples

Streaming in

Pass streaming while questions are generated. Rows append in place with no fade or rise, the newest one gets the caret and cannot be chosen until it is complete. With expected, rows still to come hold their height as static bars, so nothing grows under the pointer.

Questions append as they are written. Rows still to come hold their height as static bars.

Compact chips

Pills that wrap, for narrow panels and mobile, with a plus or an arrow.

States

Arrow glyph, disabled while a reply generates, long questions and waiting for the first question.

Props

PropTypeNotes
items(string | { id?, text })[]Required. Empty and not streaming renders nothing
onSelect(text, item) => voidSend the question
variant"list" | "chips"Defaults to list
icon"plus" | "arrow" | "none"Glyph at the end of each row. Defaults to plus
labelReactNodeHeading and accessible name. Defaults to "Related"
hideLabelbooleanKeep the name for screen readers only
streamingbooleanQuestions are still arriving
expectednumberWhile streaming, rows to hold space for
disabledbooleanFor example while another reply generates

Keyboard

KeyAction
TabMove into the list. It is one tab stop
ArrowDown, ArrowUpNext or previous question. Chips also use left and right
Home, EndFirst or last question
Enter, SpaceSend the focused question. The row shows an Enter glyph while focused

Accessibility

  • A labelled list of buttons with roving focus. The count is announced once, when streaming ends.
  • The list is aria-busy while streaming, and the partial row is disabled until it is complete.
  • Rows are at least 44 px tall. Chips grow to 44 px on touch screens.

Motion

  • Hover changes text color in 150 ms, nothing more: this is a reading surface. Chips also take the 0.97 press scale.
  • Streaming rows append with no entrance effect. Keyboard focus moves instantly.