GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.plasmic.app — Component substitution in codegen | Learn Plasmic Component substitution in codegen(See also component substitution in the Headless API.) You can use existing code components or design systems with Plasmic. One approach: you can drag and drop your code components directly in Plasmic Studio. An alternative approach is to create placeholder components in Plasmic Studio, and have them swapped out for the real thing at build or render time. You may want this if your component is very heavyweight, and you don’t need it in Plasmic Studio in either editing or preview modes. This video shows an example of performing component substitution in codegen: The workflow is:
Performing component substitutionFor instance, if you want to use a Google Maps widget:
(Side note: Adding component propsComponents are customized via props. How do we enable the design-time placeholder component in Plasmic Studio to specify props to the code component it’ll be substituted by? Meta propsYou can explicitly add meta props to the placeholder component. Then, from any instance, you can pass a value for the prop. These are not used or reflected in any way in the design-time placeholder component; you’re simply attaching metadata to the component instance. Later, when the code component is attached, these props will be forwarded to it. The meta props have simple data types like text and number. As such these are appropriate when you have some simple data to pass in. Examples of this include:
SlotsHowever, some components have Examples of this include:
For these, you would pass in other visual elements for the props (i.e. they take Is this page helpful?NoYes |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |