Web Awesome (ViUR)

Font Awesome
Try SSR Server-side rendering (SSR) generates component HTML on the server before the page loads, improving SEO and initial load time. Use the switch to see Web Awesome components render with and without SSR.
Search this website ⌘KCtrl+K Light Dark System Docs Select Color Scheme Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Select Theme View Project on GitHub Star Project on GitHub
Start Components Docs Help
Web Awesome Font Awesome Build Awesome
Search this site… /
Try SSR Server-side rendering (SSR) generates component HTML on the server before the page loads, improving SEO and initial load time. Use the switch to see Web Awesome components render with and without SSR.
Light Dark System Docs Select Color Scheme Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Select Theme

Getting Started

  • Installation
  • Usage
  • Forms
  • Localization
  • Frameworks
  • Using with AI
  • Figma Design Kit ProThis requires access to Web Awesome Pro
  • Server Rendering

Resources

  • Accessibility
  • Browser Support
  • Contributing
  • Patterns ProPatterns require access to Web Awesome Pro
  • Migrating from Shoelace
  • Visual Tests
  • Changelog
  • Help & Support

Theming & Utilities

  • Overview
  • Built-in Themes
  • Color Palettes
  • Design Tokens
  • Customizing & Theming
  • CSS Utilities

ViUR Components

  • Alert
  • Combobox
  • Pagination
  • Table Wrapper

Actions

  • Button
  • Button Group
  • Copy Button
  • Dropdown
    • Dropdown Item

Forms

  • Checkbox
  • Checkbox Group
  • Color Picker
  • Input
  • Known Date
  • Number Input
  • Radio Group
    • Radio
  • Rating
  • Select
    • Option
  • Slider
  • Switch
  • Textarea
  • Time Input
  • Data Grid Planned A Web Awesome Kickstarter stretch goal!

Layout

  • Accordion
    • Accordion Item
  • Card
  • Details
  • Dialog
  • Divider
  • Drawer
  • Page
  • Scroller
  • Split Panel

Navigation

  • Breadcrumb
    • Breadcrumb Item
  • Tab Group
    • Tab
    • Tab Panel
  • Tree
    • Tree Item

Feedback

  • Badge
  • Callout
  • Progress Bar
  • Progress Ring
  • Skeleton
  • Spinner
  • Tag
  • Tooltip

Media

  • Animated Image
  • Avatar
  • Carousel
    • Carousel Item
  • Comparison
  • Icon
  • Markdown
  • QR Code
  • Zoomable Frame

Data Viz

  • Advanced Usage

Helpers

  • Animation
  • Format Bytes
  • Format Date
  • Format Number
  • Include
  • Intersection Observer
  • Mutation Observer
  • Popover
  • Popup
  • Random Content
  • Relative Time
  • Resize Observer

Zoomable Frame

  • Examples
  • Loading External Content
  • Controlling Zoom Behavior
  • Hiding Zoom Controls
  • Preventing User Interaction
  • Enabling Theme Sync
  • Importing
  • Slots
  • Attributes & Properties
  • Methods
  • Events
  • CSS Parts
  • Dependencies
On This Page...
  • Examples
  • Loading External Content
  • Controlling Zoom Behavior
  • Hiding Zoom Controls
  • Preventing User Interaction
  • Enabling Theme Sync
  • Importing
  • Slots
  • Attributes & Properties
  • Methods
  • Events
  • CSS Parts
  • Dependencies

Zoomable Frame

<wa-zoomable-frame>
Stable Media Since 3.0

Zoomable frames embed iframe content with built-in controls for zooming, panning, and managing interaction.

<wa-zoomable-frame src="/examples/themes/showcase" zoom="0.5"> </wa-zoomable-frame>

Examples

Link to This Section

Loading External Content

Link to This Section

Use the src attribute to embed external websites or resources. The URL must be accessible, and cross-origin restrictions may apply due to the Same-Origin Policy, potentially limiting access to the iframe's content.

<wa-zoomable-frame src="https://example.com/"> </wa-zoomable-frame>

The zoomable frame fills 100% width by default with a 16:9 aspect ratio. Customize this using the aspect-ratio CSS property.

<wa-zoomable-frame src="https://example.com/" style="aspect-ratio: 4/3;"> </wa-zoomable-frame>

Use the srcdoc attribute or property to display custom HTML content directly within the iframe, perfect for rendering inline content without external resources.

<wa-zoomable-frame srcdoc="<html><body><h1>Hello, World!</h1><p>This is inline content.</p></body></html>">
</wa-zoomable-frame>

When both src and srcdoc are specified, srcdoc takes precedence.

Controlling Zoom Behavior

Link to This Section

Set the zoom attribute to control the frame's zoom level. Use 1 for 100%, 2 for 200%, 0.5 for 50%, and so on.

Define specific zoom increments with the zoom-levels attribute using space-separated percentages and decimal values like zoom-levels="0.25 0.5 75% 100%".

<wa-zoomable-frame src="/examples/themes/showcase" zoom="0.5" zoom-levels="50% 0.75 100%"> </wa-zoomable-frame>

Hiding Zoom Controls

Link to This Section

Add the without-controls attribute to hide the zoom control interface from the frame.

<wa-zoomable-frame src="/examples/themes/showcase" without-controls zoom="0.5"> </wa-zoomable-frame>

Preventing User Interaction

Link to This Section

Apply the without-interaction attribute to make the frame non-interactive. Note that this prevents keyboard navigation into the frame, which may impact accessibility for some users.

<wa-zoomable-frame src="/examples/themes/showcase" zoom="0.5" without-interaction> </wa-zoomable-frame>

Enabling Theme Sync

Link to This Section

By default, the frame does not sync theme classes into the iframe. Add the with-theme-sync attribute to mirror the host page's light/dark mode and theme selector classes (such as wa-theme-*, wa-brand-*, and wa-palette-*) into the iframe document. This is useful when the iframe renders Web Awesome styles that should match the host page's theme.

<wa-zoomable-frame src="/examples/themes/showcase" zoom="0.5" with-theme-sync> </wa-zoomable-frame>

Importing

Link to This Section

If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick a component manually, use one of the following snippets.

CDN npm Self-Hosted React

Import this component directly from the CDN:

import 'https://ka-f.webawesome.com/webawesome@0.17.0/components/zoomable-frame/zoomable-frame.js';

After installing Web Awesome via npm, import this component:

import '@awesome.me/webawesome/dist/components/zoomable-frame/zoomable-frame.js';

If you're self-hosting Web Awesome, import this component from your server:

import './webawesome/dist/components/zoomable-frame/zoomable-frame.js';

To import this component for React 18 or below, use the following code:

import WaZoomableFrame from '@awesome.me/webawesome/dist/react/zoomable-frame/index.js';

Slots

Link to This Section

Learn more about using slots.

Name Description
zoom-in-icon The slot that contains the zoom in icon.
zoom-out-icon The slot that contains the zoom out icon.

Attributes & Properties

Link to This Section

Learn more about attributes and properties.

Name Description Reflects
allowfullscreen
allowfullscreen
Allows fullscreen mode.
Type boolean
Default false
contentDocument
Returns the internal iframe's document object. (Readonly property)
Type Document | null
contentWindow
Returns the internal iframe's window object. (Readonly property)
Type Window | null
loading
loading
Controls iframe loading behavior.
Type 'eager' | 'lazy'
Default 'eager'
referrerpolicy
referrerpolicy
Controls referrer information.
Type string
sandbox
sandbox
Security restrictions for the iframe.
Type string
src
src
The URL of the content to display.
Type string
srcdoc
srcdoc
Inline HTML to display.
Type string
withoutControls
without-controls
Removes the zoom controls.
Type boolean
Default false
withoutInteraction
without-interaction
Disables interaction when present.
Type boolean
Default false
withThemeSync
with-theme-sync
Enables automatic theme syncing (light/dark mode and theme selector classes) from the host document to the iframe.
Type boolean
Default false
zoom
zoom
The current zoom of the frame, e.g. 0 = 0% and 1 = 100%.
Type number
Default 1
zoomLevels
zoom-levels
The zoom levels to step through when using zoom controls. This does not restrict programmatic changes to the zoom.
Type string
Default '25% 50% 75% 100% 125% 150% 175% 200%'

Methods

Link to This Section

Learn more about methods.

Name Description Arguments
zoomIn() Zooms in to the next available zoom level.
zoomOut() Zooms out to the previous available zoom level.

Events

Link to This Section

Learn more about events.

Name Description
error Emitted from the internal iframe when it fails to load.
load Emitted when the internal iframe when it finishes loading.

CSS Parts

Link to This Section

Learn more about CSS parts.

Name Description CSS selector
controls The container that surrounds zoom control buttons. ::part(controls)
iframe The internal <iframe> element. ::part(iframe)
zoom-in-button The zoom in button. ::part(zoom-in-button)
zoom-out-button The zoom out button. ::part(zoom-out-button)

Dependencies

Link to This Section

This component automatically imports the following elements. Sub-dependencies, if any exist, will also be included in this list.

  • <wa-icon>
Need a hand? Report a bug Ask for help
Go Make Something Awesome
Version 0.17.0 © Fonticons, Inc.
  • Terms
  • Privacy
  • Refunds
  • Core License
  • Pro License

Quick Links

  • Components
  • CSS Utilities
  • Theming
  • Using with AI
  • Changelog
  • Help & Support

Recent Searches

    D'oh! No results for “”

    Suggest on GitHub Ask on Discord
    Navigate Select
    Close Esc