This project is a simple React application that allows users to create, drag, and drop components onto a canvas. Users can interact with the components by clicking on them to select, dragging them to reposition, and configuring their properties through a modal interface.
- Component Creation: Users can create components by dragging them from the sidebar onto the canvas. The available components include Label, Input, and Button.
- Drag-and-Drop: Components on the canvas can be dragged and dropped to change their position.
- Component Selection: Clicking on a component on the canvas selects it, displaying a red border around the selected component.
- Configuration Modal: Users can configure the properties of a selected component by pressing Enter after selecting it. This action opens a modal where users can modify properties such as text, font size, and font weight.
- Automatic Persistence: All changes made to components, including creation, deletion, repositioning, and configuration, are automatically saved to local storage, ensuring persistence across page reloads.
To run this project locally, follow these steps:
- Clone the repository to your local machine.
- Navigate to the project directory in your terminal.
- Install dependencies by running
npm install
. - Start the development server by running
npm start
. - Open your web browser and go to
http://localhost:3000
to view the application.
- src/components: Contains the React components used in the project.
Component.js
: Defines the individual components (Label, Input, Button) and their behavior.ConfigModal.js
: Implements the configuration modal for modifying component properties.Canvas.js
: Implements the canvas where components are rendered and interacted with.
- src: Contains the main application files.
App.js
: Main application component that renders the Canvas component.
- public: Contains static assets and the
index.html
file. - package.json: Manages project dependencies and scripts.
- React: Front-end JavaScript library for building user interfaces.
- HTML/CSS: Markup and styling languages for structuring and styling the application.
- localStorage: Web storage API used for persistent data storage.
react
: JavaScript library for building user interfaces.react-dom
: Provides DOM-specific methods for React components.uuid
: Library for generating unique IDs.