DocsComponentsTemplatesThemesGitHub

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.json

Guidelines

  • Open beside the chat when the agent produces something to keep.

Props

PropTypeRequired
titleReact.ReactNodeYes
subtitleReact.ReactNodeNo
iconstringNo
tabsstring[]No
tabstringNo
onTabChange(v: string) => voidNo
actionsReact.ReactNodeNo
classNamestringNo
childrenReact.ReactNodeNo

Edit this example on GitHub