Skip to content

andrewlevada/lit-plasmic

Repository files navigation

Plasmic integration as Web component

npm

This web component is a simple way to integrate designs from Plasmic into your website. It is implemented using lit. Therefore, this component does not require any additional scripts or packages, so it can be used even on plain html page.

npm i lit-plasmic

How to use it?

Place component ether in lit template literal or just in html file.

<plasmic-component name="name-of-your-plasmic-component" projectId="your-project-id"
                   publicApiToken="your-public-api-token"></plasmic-component>

Don't forget to import the component!

  1. For usage in literal templates:
import "lit-plasmic";
  1. For usage in html files:
<script src="https://cdn.jsdelivr.net/npm/lit-plasmic/index.min.js" type="module"></script>

API

Here is a table of accepted attributes. Detailed descriptions can be found in Plasmic docs here.

Attribute name Type Default value
name (Required) String -
projectId (Required) String -
publicApiToken (Required) String -
version "published" or "preview" published
hydrate Boolean true
embedHydrate Boolean true
componentProps Object -
globalVariants Array -

About

Plasmic integration as Web component

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published