Enable selector box in the right panel while selecting a particular component on the canvas
See original GitHub issueWhen the user click on that component on the canvas, at the same time, we get few setting components like Typography, Margin, Appearance in right panel under Customization. But If I want to show that same name of the draggable component (like ‘Text’ or ‘Container’)that I clicked on the canvas, How can I do that ???
Below is the default code, that is used in order to enable of rendering corresponding setting component of a particular draggable component like Typography, Margin, etc. What I need to add in order to enable a feature so that name of the clicked or selected component appears on the top of right panel. Please help me to enable this feature.
import React from 'react';
import { useEditor } from '@craftjs/core';
export * from './ToolbarItem';
export * from './ToolbarSection';
export * from './ToolbarTextInput';
export * from './ToolbarDropdown';
export * from './ToolbarFontInput';
export const Toolbar = () => {
const { active, related } = useEditor((state) => ({
active: state.events.selected,
related:
state.events.selected && state.nodes[state.events.selected].related,
}));
return (
<div className="py-0 h-screen">
{active && related.toolbar && React.createElement(related.toolbar)}
{!active && (
<div
className="px-5 py-2 flex flex-col items-center h-full justify-center text-center"
style={{
color: 'rgba(255, 255, 255, 1)',
fontSize: '11px',
}}
>
<h2 className="pb-1 ">Click on a component to start editing.</h2>
<h2 className="">
You could also double click on the layers below to edit their names,
like in Photoshop
</h2>
</div>
)}
</div>
);
};
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Design, prototype, and inspect (right sidebar)
When you select a component, you can view, detach, or swap instances in the Instance menu. Any properties that are currently active will...
Read more >Manage objects with the Selection pane - Microsoft Support
You can launch the Selection pane from the Select item on the Home tab of the ribbon, or by pressing ALT+F10.
Read more >Illustrator workspace basics - Adobe Support
For example, when you select a text object, the Control panel displays ... In the search box in the upper-right corner of the...
Read more >Components | Webflow University
Select the component instance. Open the Style, Element settings, or Interactions panels, and click the “Edit component” button to edit the main component....
Read more >Report and page layout - Looker Studio Help - Google Support
Resize components: while resizing a component, blue lines appear to show when that component is the same length or width as other components...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The top right of which panel? Because in the basic example the component name is displayed in the top right:
See: Selected Button on the top right of the SettingsPanel. The corresponding code is here
Hi!
I’m not sure whether I understand you correctly. Do you want to display the component’s name in the Editor/Canvas, like this (ComplexSection)?
Taken from the landing page example from craft.js.org
This is achieved by rendering a floating box in RenderNode.tsx