Adding Widgets
Reactify provides you the ability to add widgets in the template. Please check the detailed documentation to learn, how to add the new widgets in the template.
Adding a new widget
Please follow the given steps to add a new widget in the template. We are taking an example of adding a "New Widget" on the "Ecommerce Dashboard" but you can add any widget on any of the dashboard in the template:
Step 1: Please create a new widget file(of extension .js) in the folder src->components->Widgets
. Like We have created a file named NewWidget.js
in the same folder.
Step 2: Now add the code in the widget file as per your requirements. For Example we have added the simple text block in the widget file as given in the code snippet below:
Step 3: Open the index.js
file from the src->components->Widgets
and import and then export the widget in the export
array like given in the code snippet below:
Step 4: Open src->routes->dashboard->ecommerce->index.js
file and add the NewWidget
in the div
section <div className="ecom-dashboard-wrapper">
as given in the code and also import the NewWidget
at the top like other import statements already imported.
Now save the file and open the browser, you will see your newly added widget on your dashboard like below screenshot:
Adding an existing widget
Please follow the given steps to add an existing widget in the template. We are taking an example of adding a "ToDo List" on the "Ecommerce Dashboard" but you can add any widget on any of the dashboard in the template:
Step 1: Open src->routes->dashboard->ecommerce->index.js
file and add the TodoListWidget
in the div
section <div className="ecom-dashboard-wrapper">
as given in the code and also import the TodoListWidget
at the top like other import statements already imported.
Now save the file and open the browser, you will see your newly added widget on your dashboard like below screenshot:
It does not matters whether you are using the seed project or the complete template, the steps remains the same for both.
Last updated