Skip to main content

iframe — an embedded browsing context

UiIFrame folds a whole foreign page into a semantic-ui screen — a Swagger UI, a Grafana dashboard, a legacy admin page. The framework renders the <iframe> and its sizing; what happens inside is the embedded page's business.

Two height modes, same convention as scrollpane:

  • height set — the frame caps at that CSS length in normal flow.
  • height absent — the frame fills the leftover space of a flex-column parent (the "embedded app takes the whole content pane" layout).

Fields

FieldTypeMeaning
idStringNode id — also the DOM id and the patch target.
srcStringThe embedded page's URL. Same-origin or absolute.
heightStringCSS length capping the frame's height. Absent = fill the flex parent.
sandboxStringOptional sandbox attribute value ("allow-scripts allow-same-origin"). Absent = no sandbox — fine for same-origin embeds; set it for third-party content.
titleStringBecomes the iframe's title attribute — set it, it is how screen readers name the region.
cssClassStringExtra CSS class added next to sui-iframe.

Building one

// Swagger UI as a full-height admin page
UiIFrame.of("api-explorer", "/swagger-ui/index.html")
.title("REST API explorer");

// a capped third-party embed
UiIFrame.of("status", "https://status.example.com")
.height("480px")
.sandbox("allow-scripts allow-same-origin")
.title("Service status");