@glance-networks/agent-plugin
Version:
Glance Networks Agent Plugin
41 lines (26 loc) • 937 B
Markdown
# `@glance-design/svelte-web-wrapper`
> Internal package to wrap svelte components for further use as a web component
## Usage
```
import SvelteWeb from '@glance-design/svelte-web-wrapper'
import Button from '../src/Button.svelte';
import * as styles from '../src/styles.css?inline';
export default SvelteWeb(Button, {
name: 'gds-button',
mode: 'open',
styles
});
```
## API
### SvelteWeb(Component, options)
### Arguments
- #### Component
Type: `SvelteComponent`
The svelte component to be wrapped as web component
* #### options
Type: `Object`
| Name | Type | Description |
| ---- |-----------------------------| ----------- |
| name | `string` | The name of the web component |
| mode | `string` [`open`, `closed`] | The mode of the web component |
| styles | `Object` | The styles of the web component to be injected as styleSheet in the shadow dom |