How to show overlays of components in the visual editor? #392
cruxcode
started this conversation in
Guides: Atri Framework Reference
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For most cases, you might not need to create a custom overlay for a component, rather, you want to fire an action on a component in the canvas. If you fire a
SELECT
event on a component, then the corresponding overlay to display the selected component will automatically show up. Also, the properties panel on the right will also appear displaying the properties of the selected component.If you want to synthetically fire an action on a component in the editor's canvas, then use the following APIs from
@atrilas/canvas-runtime
.In some odd cases, if you want to add an overlay, then, you can see an example here packages/overlay-hints-layer/src/overlays/useSelectOverlay.tsx.
To display an overlay:
getId
function from@atrilabs/core
<div>
inside which your overlay will be drawn. The position that you return is relative to the component whose overlay you are drawing.Beta Was this translation helpful? Give feedback.
All reactions