Prompt List
Starter prompts to pick from at the start of a chat. Each row shows an icon, a one-line label, the apps the prompt uses, and an arrow. Choosing a row hands its id back to you, so you decide whether it sends a message or opens a page.
Installation
pnpm dlx shadcn@latest add https://sprout.tulipfarm.ai/r/prompt-list.jsonCopies Prompt List and the components it uses (Brand Icon) into your app, installs the packages, and adds the styles. Then import it from @/components/ui/prompt-list. Needs Tailwind CSS 4 and a components.json from shadcn init.
Install the following dependencies:
pnpm add clsx tailwind-merge @hugeicons/core-free-icons @hugeicons/reactAdd Sprout base once per app: the
cn()helper and the design tokens.lib/sprout/classes.ts- Design tokens, for your global CSS
Add the components it uses: Brand Icon.
Copy and paste the following code into your project.
'use client'; import { useId, type ComponentProps, type CSSProperties, type ReactNode } from 'react'; import { ArrowRightIcon } from '@/lib/sprout/icons/arrow-right-icon'; import { cn } from '@/lib/sprout/classes'; import { BrandStack, type BrandStackItem } from '@/components/ui/brand-icon'; export interface PromptListItem { id: string; label: string; icon: ReactNode; brands?: readonly BrandStackItem[] | undefined; } export interface PromptListProps extends Omit<ComponentProps<'section'>, 'title' | 'children' | 'onSelect'> { title: string; showTitle?: boolean | undefined; items: readonly PromptListItem[]; onSelect: (id: string) => void; disabled?: boolean | undefined; } export function PromptList({ title, showTitle = true, items, onSelect, disabled = false, className, ...props }: PromptListProps) { const heading = useId(); return ( <section data-slot="prompt-list" data-disabled={disabled || undefined} {...props} aria-labelledby={showTitle ? heading : undefined} aria-label={showTitle ? undefined : title} className={cn('sprout-prompt-list', className)} > {showTitle && ( <h3 id={heading} className="sprout-prompt-list-title"> {title} </h3> )} <ul className="sprout-prompt-list-items"> {items.map((item, index) => ( <li key={item.id} data-slot="prompt-list-item" className="sprout-prompt-list-item" style={{ '--sprout-prompt-index': index } as CSSProperties} > <span aria-hidden="true" className="sprout-prompt-list-icon"> {item.icon} </span> <button type="button" disabled={disabled} title={item.label} onClick={() => onSelect(item.id)} className="sprout-prompt-list-button" > {item.label} </button> {!!item.brands?.length && <BrandStack brands={item.brands} className="sprout-prompt-list-brands" />} <ArrowRightIcon aria-hidden="true" className="sprout-prompt-list-arrow" /> </li> ))} </ul> </section> ); }And the files it imports:
lib/sprout/icons/arrow-right-icon.tsxlib/sprout/icons/create-icon.tsx
Add the styles to your global CSS, after
@import "tailwindcss".@layer components { .sprout-prompt-list { width: 100%; min-width: 0; font-family: var(--sprout-font); color: var(--sprout-text); } .sprout-prompt-list-title { font-size: var(--sprout-text-xs); color: var(--sprout-muted); margin: 0; padding: 0 12px 6px; font-weight: 500; line-height: 1rem; } .sprout-prompt-list-items { flex-direction: column; margin: 0; padding: 0; list-style: none; display: flex; } .sprout-prompt-list-item { --sprout-brand-ring: var(--sprout-canvas); border-radius: var(--sprout-radius-panel); min-width: 0; min-height: 32px; font-size: var(--sprout-text-sm); outline-offset: 0; outline: 0 solid #0000; align-items: center; gap: 12px; padding: 0 12px; line-height: 1.25rem; display: flex; position: relative; } @media (pointer: coarse) { .sprout-prompt-list-item { min-height: 44px; } } @media (hover: hover) { .sprout-prompt-list-item:has(.sprout-prompt-list-button:enabled):hover { --sprout-brand-ring: var(--sprout-hover); background: var(--sprout-hover); } } .sprout-prompt-list-item:has(.sprout-prompt-list-button:focus-visible) { --sprout-brand-ring: var(--sprout-hover); background: var(--sprout-hover); outline: var(--sprout-focus-width) solid var(--sprout-focus-ring); } .sprout-prompt-list-item:has(.sprout-prompt-list-button:disabled) { opacity: .5; } .sprout-prompt-list-icon { width: 20px; height: 20px; color: color-mix(in oklab, var(--sprout-text) 72%, var(--sprout-muted)); flex-shrink: 0; place-items: center; display: grid; } .sprout-prompt-list-icon svg { width: 16px; height: 16px; } .sprout-prompt-list-button { min-width: 0; font: inherit; color: inherit; text-align: start; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; -webkit-tap-highlight-color: transparent; background: none; border: 0; outline: none; margin: 0; padding: 0; overflow: hidden; } .sprout-prompt-list-button:after { content: ""; border-radius: inherit; position: absolute; inset: 0; } .sprout-prompt-list-button:disabled { cursor: not-allowed; } .sprout-prompt-list-brands { z-index: 1; position: relative; } .sprout-prompt-list-arrow { width: 14px; height: 14px; color: var(--sprout-muted); flex-shrink: 0; margin-inline-start: auto; } .sprout-prompt-list-item:dir(rtl) .sprout-prompt-list-arrow { transform: scaleX(-1); } .sprout-prompt-list-item:has(.sprout-prompt-list-button:enabled):is(:hover, :focus-within) :is(.sprout-prompt-list-icon, .sprout-prompt-list-arrow) { color: var(--sprout-text); } @media (prefers-reduced-motion: no-preference) { .sprout-prompt-list-item { animation: sprout-prompt-rise var(--sprout-motion-normal) var(--sprout-motion-ease) both; animation-delay: calc(var(--sprout-prompt-index, 0) * 40ms); transition: background-color var(--sprout-motion-fast) var(--sprout-motion-ease); } .sprout-prompt-list-icon, .sprout-prompt-list-arrow { transition: transform var(--sprout-motion-fast) var(--sprout-motion-ease), color var(--sprout-motion-fast) var(--sprout-motion-ease); } .sprout-prompt-list-item:has(.sprout-prompt-list-button:enabled):is(:hover, :focus-within) .sprout-prompt-list-icon { transform: scale(1.08); } .sprout-prompt-list-item:has(.sprout-prompt-list-button:enabled):is(:hover, :focus-within) .sprout-prompt-list-arrow:not(:dir(rtl)) { transform: translateX(2px); } } @keyframes sprout-prompt-rise { from { opacity: 0; transform: translateY(4px); } } @media (forced-colors: active) { .sprout-prompt-list-item:has(.sprout-prompt-list-button:focus-visible) { outline-color: highlight; } } }Import it from
@/components/ui/prompt-list. Update the paths if your@/alias points elsewhere.
pnpm add @tulipfarm/sprout@import "tailwindcss";
@import "@tulipfarm/sprout/styles.css";The package keeps the source and ships fixes with each release. Import from @tulipfarm/sprout/prompt-list.
Start with a task
Set up your workspace
Optional. You can start a task now.
Nothing chosen yet.
Usage
import { PromptList, type PromptListItem } from "@tulipfarm/sprout/prompt-list";
import { CalendarSearchIcon, TasksIcon } from "@tulipfarm/sprout/icons";
const items: PromptListItem[] = [
{
id: "meetings",
label: "Prepare me for tomorrow's meetings",
icon: <CalendarSearchIcon />,
brands: [{ brand: "google-calendar", name: "Google Calendar" }],
},
{ id: "follow-ups", label: "Plan customer follow-ups", icon: <TasksIcon /> },
];
<PromptList
title="Start with a task"
items={items}
disabled={sending}
onSelect={(id) => send(promptFor(id))}
/>title: names the list. It shows as a small heading unlessshowTitleisfalse; then it is only the list's accessible name.items:{ id, label, icon, brands? }[].iconis drawn at 16px.brandsis a list of{ brand, name }shown as aBrand Stack.onSelect(id): called when a row is chosen.disabled: locks every row, for example while a message sends.
Prompt List has one look and one size: 32px rows, 44px on touch screens. It fills the width it gets.
Starting tasks
The example above is the chat start screen. Three tasks show first; the rest sit in a second list with a hidden title inside aCollapsible. Setup steps follow in their own list. Load messages and errors use plain text, anAlert, and a reloadButton. Change the controls to see each state.
<PromptList title="Start with a task" disabled={sending} onSelect={choose} items={rows(primary)} />
<Collapsible open={moreOpen} onOpenChange={setMoreOpen}>
<CollapsibleContent>
<PromptList title="More tasks" showTitle={false} disabled={sending} onSelect={choose} items={rows(more)} />
</CollapsibleContent>
<CollapsibleTrigger render={<Button variant="ghost" size="sm" />}>
{moreOpen ? "Fewer tasks" : `More tasks (${more.length})`}
</CollapsibleTrigger>
</Collapsible>Title shown or hidden
Hide the title when the list continues one above it, such as “More tasks”. Screen readers still hear the title.
showTitle (default)
Start with a task
showTitle={false}, inside “More tasks”
Nothing chosen yet.
Apps a prompt uses
A row can show no apps, one, or several. Tiles overlap, and hovering one shows the app name.
Start with a task
Nothing chosen yet.
Disabled
Disabled rows fade to half opacity and ignore hover and clicks.
Enabled
Set up your workspace
disabled
Set up your workspace
Long labels
Labels stay on one line and end with an ellipsis. Hover shows the full label.
Start with a task
Starter prompts
A short list with a status line that reports the choice.
Enabled
Try a fictional task
No prompt selected.
disabled
Unavailable prompts
Accessibility
The list is a section named by its title, which is anh3, with a list of rows. Each row's label is a realbutton, so Tab moves between rows and Enter or Space chooses one. The whole row is the click target. A focused row gets the hover fill and a 2px focus ring. Icons and arrows are hidden from screen readers; the app tiles read as one image named by the app names.
Rows rise in one after another, and hovering one lifts its icon and nudges its arrow over 120–180ms. With reduced motion nothing moves. In forced colors mode the focus ring uses the system highlight.
Theme tokens
Hover and focus fills use --sprout-hover, the focus ring--sprout-focus, and the title and arrow--sprout-muted. App tile rings follow the row fill. Prompt List has no brand color of its own, so it looks the same in the neutral and TulipFarm themes apart from the focus ring.