Artifact

Frames something an agent produced, such as a table or a chart, under a title bar with its actions.

Q3 pipeline risk
3 accounts scored · $850K at stake
AccountStageValueRisk
Acme CorpNegotiation$540KHigh
NorthwindProposal$212KMedium
GlobexDiscovery$98KLow

Configurations

Supported configurations for this component.

Configurations

3 examples
Full title bar
Q3 pipeline risk
3 accounts scored · $850K at stake
AccountStageValueRisk
Acme CorpNegotiation$540KHigh
NorthwindProposal$212KMedium
GlobexDiscovery$98KLow
Title and one action
Q3 pipeline risk
AccountStageValueRisk
Acme CorpNegotiation$540KHigh
NorthwindProposal$212KMedium
GlobexDiscovery$98KLow
No actions
Q3 pipeline risk
3 accounts scored · $850K at stake
AccountStageValueRisk
Acme CorpNegotiation$540KHigh
NorthwindProposal$212KMedium
GlobexDiscovery$98KLow

Add to your project

One command adds this component to your project.

1

Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.

npx shadcn@latest add @aicanvas/••••••••••••

Light and dark both come with the install and follow the dark class on <html>, the shadcn dark mode setup (next-themes with attribute="class").

Props

Every prop this component accepts. Any other prop is forwarded to the underlying element.

Artifact

PropTypeDefaultDescription
childrenReact.ReactNode-ArtifactHeader, then ArtifactContent.
classNamestring-Extra classes merged onto the frame.
styleReact.CSSProperties-Inline styles merged onto the frame.

ArtifactHeader

PropTypeDefaultDescription
iconPhosphorIcon-Leading glyph naming the kind of thing the artifact is, in text.muted at 16px (the 12px title's rung on the icon-label ladder).
childrenReact.ReactNode-ArtifactTitle and ArtifactDescription, stacked in the flexible column; an ArtifactActions child is lifted out to the trailing end.
classNamestring-Extra classes merged onto the bar.
styleReact.CSSProperties-Inline styles merged onto the bar.

ArtifactText

PropTypeDefaultDescription
childrenReact.ReactNode-Content rendered inside the component.
classNamestring-Extra classes merged onto the line.
styleReact.CSSProperties-Inline styles merged onto the line.

ArtifactAction

PropTypeDefaultDescription
labelreqstring-REQUIRED. The action's name: the button's aria-label and the tooltip's text.
iconreqPhosphorIcon-REQUIRED. Phosphor glyph, drawn at the sm rung (16px) by IconButton.
tooltipbooleantrueShow the label in a Tooltip under the button on hover and focus. It portals out of the Artifact frame (which clips) and stays inline anywhere else, such as a DrawerHeader.
hideBelow'sm'|'md'-Hide the action below that breakpoint. Only for a secondary action that stays reachable elsewhere (the expanded view keeps it).
onClick(e: React.MouseEvent<HTMLButtonElement>) => void-What the action does. An action with no handler is a dead control: leave it out instead.
disabledboolean-When true, disables the control.
classNamestring-Extra classes merged onto the button.
styleReact.CSSProperties-Inline styles merged onto the button.

ArtifactClose

PropTypeDefaultDescription
labelstring'Close'The button's aria-label and tooltip text.

More Andromeda Pro components