Questions

@sushindustries/ui

The questions a page expects to be asked, written beside the prose that provokes them and answerable in place.

6 min read
View as MarkdownEdit on GitHub

Examples are the tab where the component is shown doing a job, not demonstrating a prop. The API tab already lists the props.

Viewport width
Phone22remthe floor, the narrowest this promises to work at
tanstacktanstack add https://adamjurek.com/r/tanstack/questions.jsonshadcnpnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/questions.json

Press Compare. The frames are real viewports, so a layout that breaks at 320 breaks here too rather than in somebody's hands.

In a page

import { Questions } from "@sushindustries/ui";
import { useAssistant } from "../hooks/use-assistant";

export function DocsFooter() {
	const { ask } = useAssistant();

	return (
		<footer className="container mt-12">
			<Questions
				heading="Try asking"
				questions={[
					"What does renderLink do?",
					"How do I add a package to the registry?",
				]}
				onAsk={ask}
			/>
		</footer>
	);
}
tsx

What this example is not

Wired to a real assistant. useAssistant here stands in for whatever puts a question in front of one - this component only calls onAsk, it never answers anything itself.