ArtifactPanel
Side panel for an agent's output (document, code, preview) with tabs and actions.
Code
import * as React from 'react';
import { ArtifactPanel, CodeBlock, IconButton } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
maxWidth: 560,
}}
>
<ArtifactPanel
title="landing-page.html"
subtitle="Updated just now"
icon="file"
tabs={['Preview', 'Code']}
tab="Code"
actions={<IconButton icon="download" label="Download" size="sm" variant="plain" />}
>
<CodeBlock
title="index.html"
code={'<main class="hero">\n <h1>Spring launch plan</h1>\n</main>'}
/>
</ArtifactPanel>
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { ArtifactPanel } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/artifact-panel.jsonGuidelines
- Open beside the chat when the agent produces something to keep.
Props
| Prop | Type | Required |
|---|---|---|
title | React.ReactNode | Yes |
subtitle | React.ReactNode | No |
icon | string | No |
tabs | string[] | No |
tab | string | No |
onTabChange | (v: string) => void | No |
actions | React.ReactNode | No |
className | string | No |
children | React.ReactNode | No |