Skip to content
AI Elements

Web Preview

Sandboxed iframe preview with URL chrome and a console.

Import

tsx
import { WebPreview } from "@cronus-ui/ui";
bash
npx cronus-ui add web-preview

Examples

API Reference

Generated from the component's exported types.

WebPreviewLabels

Skip WebPreviewLabels props table
PropTypeDefaultDescription
urlPlaceholder*
string
preview*
string
console*
string
consoleEmpty*
string

WebPreviewProps

Extends HTMLAttributes<HTMLDivElement>

Skip WebPreviewProps props table
PropTypeDefaultDescription
ref
Ref<HTMLDivElement>Ref forwarded to the underlying DOM node.
defaultUrl
string""
onUrlChange
(url: string) => void
labels
Partial<WebPreviewLabels>Override default English strings.

WebPreviewNavigationProps

Extends HTMLAttributes<HTMLDivElement>

Skip WebPreviewNavigationProps props table
PropTypeDefaultDescription
ref
Ref<HTMLDivElement>Ref forwarded to the underlying DOM node.

WebPreviewNavigationButtonProps

Extends ButtonProps

Skip WebPreviewNavigationButtonProps props table
PropTypeDefaultDescription
tooltip
string

WebPreviewUrlProps

Extends InputProps

No own props — see the extended type above for available props.

WebPreviewBodyProps

Extends ComponentProps<"iframe">

Skip WebPreviewBodyProps props table
PropTypeDefaultDescription
ref
Ref<HTMLIFrameElement>Ref forwarded to the underlying DOM node.
loading
ReactNode

WebPreviewConsoleProps

Extends HTMLAttributes<HTMLDivElement>

Skip WebPreviewConsoleProps props table
PropTypeDefaultDescription
ref
Ref<HTMLDivElement>Ref forwarded to the underlying DOM node.
logs
WebPreviewConsoleLog[][]