Skip to content

ArtifactFrame

Warning strip + sandboxed iframe for user/agent-generated HTML. The pane stays light in dark mode by design — theme the frame, never the content.

Prop Type Notes
label React.ReactNode Engraved strip label; default "Sandboxed".
note React.ReactNode Warning copy beside the label.
src string
srcDoc string
height number | string
allow string iframe sandbox value; default "" (fully locked: no scripts).
title string
className string

Other props pass through to the root element (React.HTMLAttributes<HTMLDivElement>).

Preview

Declarations

TypeScript
export interface ArtifactFrameProps extends React.HTMLAttributes<HTMLDivElement> {
  /** Engraved strip label; default "Sandboxed". */
  label?: React.ReactNode;
  /** Warning copy beside the label. */
  note?: React.ReactNode;
  src?: string;
  srcDoc?: string;
  height?: number | string;
  /** iframe sandbox value; default "" (fully locked: no scripts). */
  allow?: string;
  title?: string;
  className?: string;
}

/**
 * Warning strip + sandboxed iframe for user/agent-generated HTML. The pane
 * stays light in dark mode by design — theme the frame, never the content.
 */
export function ArtifactFrame(props: ArtifactFrameProps): React.JSX.Element;