A lightweight web component that renders HTML content within a configurable frame.
The qds-page-frame
component creates a container with configurable dimensions for displaying HTML content. It provides a simple way to embed and render HTML strings within a page with controlled dimensions.
<qds-page-frame
html-content="<p>Your HTML content here</p>"
width="800px"
height="600px">
</qds-page-frame>
Include the component in your project:
<script src="https://cdn.q360.ai/assets/components/page-frame/qds-page-frame.js" type="module"></script>
Or import it in your JavaScript:
import "https://cdn.q360.ai/assets/components/page-frame/qds-page-frame.js";
You can also load all components at once:
<script src="https://cdn.q360.ai/assets/components/index.js" type="module"></script>
Attribute | Type | Description | Default |
---|---|---|---|
html-content |
String | HTML content to display | Empty HTML template |
width |
String | Width of the frame (CSS value) | “1024px” |
height |
String | Height of the frame (CSS value) | “100%” |
The component also exposes the following JavaScript properties:
htmlContent
: Get or set the HTML contentwidth
: Get or set the widthheight
: Get or set the heightExample:
const pageFrame = document.querySelector('qds-page-frame');
pageFrame.htmlContent = '<p>New content</p>';
pageFrame.width = '500px';
The component can be styled through its attributes or by targeting the host element:
qds-page-frame {
max-width: 800px;
width: 800px;
}
This component uses standard Web Component APIs and works in all modern browsers that support Custom Elements v1.