Review and revise a generated draft
The request handler now retains the original draft when a send fails.
Add a test for a rejected request and confirm that the retry uses the same content.
Frames generated content with header actions, an optional scroll region and a close request.
The request handler now retains the original draft when a send fails.
Add a test for a rejected request and confirm that the retry uses the same content.
The request handler now retains the original draft when a send fails.
Add a test for a rejected request and confirm that the retry uses the same content.
npm install @noorddev/vlak-react
Load the stylesheet once at your app root, then import the components you use.
import "@noorddev/vlak-react/css";
import { Artifact, Button } from "@noorddev/vlak-react";Per-component imports are available at @noorddev/vlak-react/components/artifact.
npx @noorddev/vlak-cli add artifact
Adds the component and its dependencies to components/vlak/. Follow the StyleX setup to compile the source in your application.
npx shadcn add https://vlak.dev/r/artifact.json
Installs the same source through the shadcn CLI.
import { Artifact, Button } from "@noorddev/vlak-react";
export function ReviewArtifact({ onRevise }: { onRevise: () => void }) {
return <Artifact title="Review notes" description="Draft 1" maxHeight="20rem" actions={<Button variant="subtle" onClick={onRevise}>Revise draft</Button>} footer="Local draft">
<p>Retain the original draft when sending fails.</p>
</Artifact>;
}See the integration example to compose these components with your application's model and data.
Generated content with header actions, a close request and an optional scroll region.
| Prop | Type | Default | Description |
|---|---|---|---|
titlerequired | ReactNode | ||
description | ReactNode | ||
actions | ReactNode | ||
footer | ReactNode | ||
onClose | () => void | Requests closing; the application owns visibility and focus restoration. | |
closeLabel | string | "Close artifact" | |
maxHeight | Property.MaxHeight<string | number> | Optional height cap for long generated content. |
Also accepts Omit<HTMLAttributes<HTMLElement>, "title">.
The ref reaches HTMLElement.
| Keys | Does |
|---|---|
| Tab | Tab reaches supplied actions, the labelled close control and a height-limited content region. |
| Enter, Space | Enter or Space activates the focused button. |
The same styles are available as CSS. Native HTML provides the static presentation; React or application code supplies state updates and actions.
npm install @noorddev/vlak
import "@noorddev/vlak/css";
<section class="rs-artifact" aria-labelledby="artifact-title"><header class="rs-artifact-header"><div class="rs-artifact-heading"><span class="rs-artifact-title" id="artifact-title">Review notes</span><div class="rs-artifact-description">Draft 1</div></div></header><div class="rs-artifact-content"><p>Retain the original draft when sending fails.</p></div><footer class="rs-artifact-footer">Local draft</footer></section>