Creating your own primitives like links, buttons, textboxes, as components

In Plasmic, you can always insert “primitive” elements, such as a link, button, or textbox. These are slightly more interesting than boxes and text elements, since they have functional behavior, with various props to configure.

Once you’ve configured or styled (say) a link, you’ll likely want to reuse this in a bunch of places. You can do this by creating a component: just right-click on the element and select “Create component.” You can call it something like “Standard Link.” From now on, rather than inserting a primitive link element, you can insert your new “Standard Link” component.

But now, how do you specify the various props on links, such as the destination URL?

Simply expose the props on the “Standard Link” component:

  1. Edit the Standard Link component.
  2. Select the link element inside of it.
  3. In the right sidebar, right-click the props you want to expose, and select ”.”
Expose prop

(This is the same as you would expose the prop on any element inside any component.)

Full video demonstration:

Was this page helpful?

Have feedback on this page? Let us know on our forum.