Sandbox
<ol-sandbox> | OlSandbox
Sandbox tool for viewport testing.
<ol-sandbox> <div style="height: 100%; width: 100%; background: var(--ol-color-neutral-100);"></div> </ol-sandbox>
import OlSandbox from '@onlive.site/ui/dist/react/sandbox'; const App = () => ( <OlSandbox> <div style="height: 100%; width: 100%; background: var(--ol-color-neutral-100);"></div> </OlSandbox> );
Examples
Sidebar
Use left sidebar.
<ol-sandbox sidebar> <div slot="sidebar" style="height: 400px; width: 100%; background: var(--ol-color-neutral-50);"></div> <div style="height: 100%; width: 100%; background: var(--ol-color-neutral-100);"></div> </ol-sandbox>
import OlSandbox from '@onlive.site/ui/dist/react/sandbox'; const App = () => ( <OlSandbox sidebar> <div slot="sidebar" style="height: 400px; width: 100%; background: var(--ol-color-neutral-50);"></div> <div style="height: 100%; width: 100%; background: var(--ol-color-neutral-100);"></div> </OlSandbox> );
Importing
If you’re using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.
To import this component from the CDN using a script tag:
<script type="module" src="https://cdn.onlive.site/@onlive.site/ui@1.8.20/cdn/components/sandbox/sandbox.js"></script>
To import this component from the CDN using a JavaScript import:
import 'https://cdn.onlive.site/@onlive.site/ui@1.8.20/cdn/components/sandbox/sandbox.js';
To import this component using a bundler:
import '@onlive.site/ui/dist/components/sandbox/sandbox.js';
To import this component as a React component:
import OlSandbox from '@onlive.site/ui/dist/react/sandbox';
Slots
Name | Description |
---|---|
(default) | The default slot. |
sidebar
|
Sidebar slot. |
Learn more about using slots.
Properties
Name | Description | Reflects | Type | Default |
---|---|---|---|---|
sidebar
|
Show sidebar |
boolean
|
false
|
|
updateComplete |
A read-only promise that resolves when the component has finished updating. |
Learn more about attributes and properties.
Parts
Name | Description |
---|---|
base |
The component’s base wrapper. |
sidebar |
The component’s sidebar wrapper. |
content |
The component’s content wrapper. |
viewport |
The component’s viewport wrapper. |
Learn more about customizing CSS parts.
Dependencies
This component automatically imports the following dependencies.
<ol-button-group>
<ol-icon>
<ol-icon-button>
<ol-option>
<ol-popup>
<ol-radio-button>
<ol-radio-group>
<ol-select>
<ol-tag>