Get started

NPM installation

npm i @symbiotejs/symbiote

Note, that if you are using CDN module sharing approach, you should add package to a devDependencies section, because it will be used for the code static analysis only (TypeScript and "Go to Definition" support).

Installation as a dev dependency:

npm install @symbiotejs/symbiote --save-dev


To easily share Symbiote.js as a common dependency between independent application parts (widgets, micro-frontends, meta-applications), you can use one of the modern code CDNs:

import { Symbiote } from '';

TypeScript support (my-types.d.ts):

// List out all your dependencies. 
// For every URL, you must map it to its local module:

declare module '' {
  export * from '@symbiotejs/symbiote';

In some cases, you will need to add maxNodeModuleJsDepth setting to your tsconfig.json file:

  "compilerOptions": {
    "allowJs": true,
    "maxNodeModuleJsDepth": 2

Also, you can publish your own Symbiote.js build as a regular static file to your own server and to use it via HTTPS. The ability to use HTTPS-imports is supported in all modern browsers.

It's convenient to define the common base class for your application to have ability to manage HTTPS dependency in one place and to have an endpoint for any app-level extensions:

import { Symbiote } from '';

export class AppComponent extends Symbiote {
  // Your code...

Git submodule (optional)

Initial submodule connection:

git submodule add -b main ./symbiote

Activation at the cloned host repository and getting updates:

git submodule update --init --recursive --remote

Switch to the certain revision:

cd symbiote && git checkout <VERSION_TAG>

package.json scripts section example:

  "scripts": {
    "git-modules": "git submodule update --init --recursive --remote",
    "sym-version": "cd symbiote && git checkout <VERSION_TAG> && cd ..",
    "setup": "npm run git-modules && npm run sym-version && npm i"


npm run setup

Your first Symbiote-component

Create the HTML file my-app.html:

<script type="importmap">
    "imports": {
      "@symbiotejs/symbiote": ""

<script type="module">
  import Symbiote, { html, css } from '@symbiotejs/symbiote';

  export class MyComponent extends Symbiote {

    // Initiate state:
    init$ = {
      count: 0,
      increment: () => {


  // Define template:
  MyComponent.template = html`
    <button ${{onclick: 'increment'}}>Click me!</button>

  // Describe styles:
  MyComponent.rootStyles = css`
    my-component {
      color: #f00;

  // Register the new HTML-tag in browser:


That's it! Open this HTML file in your browser and check the result.

To run this example, you'll need a browser and the text editor only. No any installation, build setup or local server is required in this case.

Platform specs & Standards

It's important to know, what are the Web Components in general. Here we provide some links to the useful platform documentation (MDN):