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