制品画布面板

New

AI 产物的画布侧栏:发丝面板壳、带操作簇的头部、交叉淡切的预览/代码双视图切换,以及带恢复按钮的版本导航。

Build a hero section for the landing page.
Drafted the landing hero — see the artifact.
landing-hero.tsxReact component

Ship your product, faster.

Everything you need to launch, in one kit.

Get startedView docs
v3 / 3
Updated just now

安装

用 shadcn CLI 添加,或手动复制源码。

$ bunx --bun shadcn add @uilab/artifact-panel

API 参考

ArtifactPanel

className?
string

ArtifactHeader

icon?
ReactNode

16px leading icon, e.g. `<FileCode2 className="h-4 w-4" />`.

title
ReactNode
subtitle?
ReactNode

Rendered beside the title on the same line, truncating independently.

actions?
ReactNode

Trailing slot for the caller's own controls — copy/download buttons, an `ArtifactViewToggle`.

className?
string

ArtifactAction

aria-label
string
onClick?
(() => void)
className?
string

ArtifactViewToggle

value
"code" | "preview"
onChange
(next: ArtifactView) => void
previewLabel?
ReactNode
Preview
codeLabel?
ReactNode
Code
className?
string

ArtifactContent

view?
string | number

When passed, `children` cross-fades keyed on this value (e.g. the active `ArtifactView`, or a composite key that also folds in a version so version switches transition too). Omit for static content that never swaps.

className?
string

ArtifactVersionNav

index
number

1-based position of the version currently shown.

count
number
onPrev?
(() => void)
onNext?
(() => void)
onRestore?
(() => void)

Renders a trailing ghost "Restore" button when passed — the caller decides when restoring makes sense (e.g. only on non-latest versions).

restoreLabel?
ReactNode
Restore
className?
string

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.