Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vscode-elements/webview-playground

Handy web components for emulating the VSCode Webview environment.
https://github.com/vscode-elements/webview-playground

visual-studio-code vscode vscode-webview webcomponents

Last synced: 13 days ago
JSON representation

Handy web components for emulating the VSCode Webview environment.

Awesome Lists containing this project

README

        

# VSCode Webview Playground

Handy web components for emulating the VSCode Webview environment.

## Installation

Install as npm package:

```
npm install -D @vscode-elements/webview-playground
```

Alternatively, you can just copy the files from the `/dist` directory into your project.
They are pure JavaScript files, so no bundler is required. It’s up to you how to exclude them from the production build.

## Available components

### <vscode-dev-toolbar>

Insert theme variables and default styles into the page. It appears as a button in the lower right corner. When clicked, a simple toolbar is displayed.

![Dev toolbar button](https://github.com/vscode-elements/webview-playground/raw/main/image.png)

```html


Webview Playground

```

The button can be hidden by the `hidden` attribute or `hidden` property:

```javascript
document.querySelector('vscode-dev-toolbar').hidden = true;
```

### <vscode-demo>

An isolated block intended for use in a documentation site, e.g., Storybook. It inserts the theme variables but doesn't modify the host page's styles.

![alt text](https://github.com/vscode-elements/webview-playground/raw/main/image-1.png)

```html


Webview Playground


42

```

### Internal components

Further "private" components:

- <vscode-theme-selector>
- <vscode-toggle-motion>
- <vscode-toggle-underline>
- <vscode-view-container-selector>