DocsBlog

Get Started

Components

Data Grid

Signals

Styling

Theming

↑↓Navigate
↵Select
EscClose
  • 1.8.0

  • Day

    Night

    Preview

    Switch mode
  • cerberus

    acheron

    elysium

    oceanus

Get Started
Components
Data Grid
Signals
Styling
Theming

Concepts

OverviewCompositionCerberus ContextTesting

Layout

Aspect RatioBleedBoxCenterContainerContainer QueryDividerFlexFloatGridGroupLink OverlayScrollableStackWrap

Components

AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTA ModalDate PickerDialogFieldFieldsetFile UploaderIconButtonInputLoading StatesMarqueeMenuNotificationsNumber InputPaginationPin InputPopoverProgress IndicatorsPrompt ModalRadioRatingSelectSliderSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

Utilities

Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFormat Relative TimeFrameHighlightJSON Tree ViewLocalePortalPresenceShowSwapsplitPropsTheme

Frame

Used to render a component in an iframe

  • npm
View as Markdown
Open this page in Markdown
Anthropic
Open in Claude
Ask questions about this page
OpenAI
Open in ChatGPT
Ask questions about this page

Import

The Frame component is used to render a component in an iframe.

  • Tracks the size of the content and exposes them via css variables.
  • Support for head prop to inject scripts and styles.
  • Support for mount and unmount callbacks.
import { Frame } from '@cerberus/react'

Usage

Basic

Wrap your component in the Frame component to render it in an iframe.

Loading example...

Injecting Script

Using the onMount prop, you can inject a script into the iframe.

Loading example...

Custom src doc

Use the srcDoc prop to specify the HTML content of the page to use in the iframe.

Loading example...

API Reference

Props

PropTypeRequiredDefaultDescription
headstring | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...>falseundefinedAdditional content to be inserted into the frame's <head>
onMount() => voidfalseundefinedCallback function to be executed when the frame is mounted
onUnmount() => voidfalseundefinedCallback function to be executed when the frame is unmounted

On this page

  • Import
  • Usage
    • Basic
    • Injecting Script
    • Custom src doc
  • API Reference
Edit this page on Github