Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/bennypowers/codesandbox-button

Custom Element that Shows a CodeSandbox demo when you click on it.
https://github.com/bennypowers/codesandbox-button

Last synced: 21 days ago
JSON representation

Custom Element that Shows a CodeSandbox demo when you click on it.

Awesome Lists containing this project

README

        

## `codesandbox-button.js`:

### class: `CodesandboxButton`, `codesandbox-button`

#### Superclass

| Name | Module | Package |
| ------------ | ------ | ------- |
| `LitElement` | | lit |

#### Fields

| Name | Privacy | Type | Default | Description | Inherited From |
| ---------------- | ------- | --------------------- | -------- | ------------------------------------------------------ | -------------- |
| `fontSize` | | `number` | `14` | font size | |
| `hideNavigation` | | `boolean` | `false` | when true, hides navigation in the iframe | |
| `sandboxId` | | `string` | | five-character id of your sandbox | |
| `showDemo` | | `boolean` | `false` | when true, shows the CodeSandbox instead of the button | |
| `module` | | `string` | | path to the default module to display | |
| `theme` | | `'light'\|'dark'` | `'dark'` | | |
| `view` | | `'editor'\|'preview'` | | | |

#### Attributes

| Name | Field | Inherited From |
| ----------------- | -------------- | -------------- |
| `font-size` | fontSize | |
| `hide-navigation` | hideNavigation | |
| `sandbox-id` | sandboxId | |
| `show-demo` | showDemo | |
| `module` | module | |
| `theme` | theme | |
| `view` | view | |

Private API

#### Methods

| Name | Privacy | Description | Parameters | Return | Inherited From |
| -------------- | ------- | ----------- | ---------- | ------ | -------------- |
| `getIframeSrc` | private | | | | |
| `onClick` | private | | | | |


### Exports

| Kind | Name | Declaration | Module | Package |
| --------------------------- | -------------------- | ----------------- | --------------------- | ------- |
| `js` | `CodesandboxButton` | CodesandboxButton | codesandbox-button.js | |
| `custom-element-definition` | `codesandbox-button` | CodesandboxButton | codesandbox-button.js | |