Rewrite Panel
The mode and model list with a Rewrite button that opens from Rewrite and More.
import { Card } from "@/components/ui/card";
import { PerplexityRewritePanel } from "../components/perplexity-rewrite-panel";
export default function PerplexityRewritePanelExample() {
return (
<Card className="bg-pplx-bg ring-pplx-border flex w-full min-w-0 flex-row justify-center gap-0 rounded-2xl p-6">
<PerplexityRewritePanel className="bg-pplx-popover rounded-2xl p-1.5" />
</Card>
);
}
$ bunx --bun shadcn@latest add @notra/perplexity-rewrite-panelPerplexity shows this panel when you rewrite an answer. It lists the modes, Search, Deep research and Learn step by step, with a check on the selected one. Below a separator sit the “Access the top AI models” row and the model list in a shadcn ScrollArea, and a full-width Rewrite button closes it. Locked modes and models show a lock. PerplexityActions opens it from the Rewrite action in a shadcn Popover, and from More → Rewrite in a DropdownMenuSub.
| Prop | Default | Description |
|---|---|---|
modes |
Search, Deep research, Learn step by step | The mode rows. |
defaultMode |
search |
The mode that starts checked. |
models |
PERPLEXITY_MODELS |
The model list. |
promoLabel |
Access the top AI models |
The label of the promo row. |
onRewrite |
Called with { mode } when Rewrite is pressed. |
|
onClose |
Called after Rewrite, so a host popover can close. |
Used in
Perplexity
A full recreation of a Perplexity thread with search steps, citations with hover cards and the composer.