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
.cronus
No audit fixture declares this family in .cronus yet.
API Reference
Generated from the component's exported types.
WebPreviewLabels
| Prop | Type | Default | Description |
|---|---|---|---|
urlPlaceholder* | string | — | — |
preview* | string | — | — |
console* | string | — | — |
consoleEmpty* | string | — | — |
WebPreviewProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
ref | Ref<HTMLDivElement> | — | Ref forwarded to the underlying DOM node. |
defaultUrl | string | "" | — |
onUrlChange | (url: string) => void | — | — |
labels | Partial<WebPreviewLabels> | — | Override default English strings. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |
WebPreviewNavigationProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
ref | Ref<HTMLDivElement> | — | Ref forwarded to the underlying DOM node. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |
WebPreviewNavigationButtonProps
Extends ButtonProps
| Prop | Type | Default | Description |
|---|---|---|---|
tooltip | string | — | — |
variant | string | — | Visual variant. |
size | string | — | Control size. |
asChild | boolean | — | Render as the child element via Slot. |
disabled | boolean | — | Disables pointer and keyboard interaction. |
type | string | — | Native type of the underlying element. |
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
WebPreviewUrlProps
Extends InputProps
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled value. |
defaultValue | string | — | Uncontrolled initial value. |
onChange | (event: ChangeEvent<HTMLInputElement>) => void | — | Called when the value changes. |
placeholder | string | — | Placeholder shown when the value is empty. |
disabled | boolean | — | Disables pointer and keyboard interaction. |
name | string | — | Submitted name when used in a form. |
required | boolean | — | Marks the control as required. |
className | string | — | Additional class names merged onto the root. |
WebPreviewBodyProps
Extends ComponentProps<"iframe">
| Prop | Type | Default | Description |
|---|---|---|---|
ref | Ref<HTMLIFrameElement> | — | Ref forwarded to the underlying DOM node. |
loading | ReactNode | — | — |
WebPreviewConsoleProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
ref | Ref<HTMLDivElement> | — | Ref forwarded to the underlying DOM node. |
logs | WebPreviewConsoleLog[] | [] | — |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |