009
An answer whose footnotes really point somewhere: hover a number and its sentence lights up in the source's colour, click it and the quoted passage unfolds with the matching words marked.
akacitations·sources
Run this in any project set up for the shadcn CLI. It copies the Footnoted Answer source into your components folder, so the code is yours to change.
npx shadcn@latest add https://devl.dev/r/footnoted-answer.jsonImport it and render it. Every prop has a typed default, so it works straight away, and you pass your own data when you’re ready.
import { FootnotedAnswer } from "@/components/footnoted-answer";
export default function Page() {
return <FootnotedAnswer />;
}A free React component in the Conversation collection, written in TypeScript with Tailwind CSS on coss ui. MIT licensed.
Read from the Footnoted Answer source. Everything is optional unless it says required.
| Prop | Type | Default |
|---|---|---|
| sentences | FootnotedSentence[] | defaultSentences |
| sources | FootnoteSource[] | defaultSources |
| className | string | — |