The progress in web development is a double-edged sword. Countless libraries and frameworks give you freedom of choice, but sometimes such a variety confuses. A large number of options may lead to so-called choice overload, a situation where decision-making becomes too overwhelming, and people prefer not to choose at all. Today, we’ll try to help you avoid this situation when choosing a library for building a web app UI.

We’ll use React, Vue.js, and Webix to build a data dashboard for a web application. It won’t be yet another article about the pros and cons of these libraries described with dry theoretical formulations or technical details understandable to a select few specialists. Instead, we’ll try to satisfy the interest of business decision-makers in determining labor costs required for solving a specific problem with different tools.

There are many different libraries, and we do not claim these three are the best. We chose React, Vue.js, and Webix because our experience of using them outweighs all other options. We will remain neutral, refrain from expressing our opinions, and let the facts speak for ourselves.

What We Will Build

Above, you can see the data dashboard with a typical structure:

  • Sidebar;
  • Header;
  • Dashboard body.

We can decompose these parts into a set of smaller elements to understand what we’ll need to build to solve our task.

Sidebar

The sidebar of this data dashboard includes the following components:

  1. Logo and button that expands or collapses the menu;
  2. Administrator info;
  3. Hierarchical menu;
  4. Buttons at the bottom.

Dashboard Header

It’s a simple dashboard part. It has a title and a couple of buttons:

Dashboard Body

The dashboard body displays tons of data. It’s the most complex part of our solution that includes many different elements. Here they are:

  1. Projects;
  2. Employees;
  3. Customers;
  4. Revenue;
  5. Dug Meters Per Day;
  6. Gas Produced in the Region;
  7. Oil Produced in the Region.

NOTE: If you’re not interested in the technical details of dashboard implementation, you can proceed to the Summing Up the Results section, where we will determine which library coped with the task faster and figure out why.

React Dashboard

One of React’s features is its component-based development approach. Usually, components are reused multiple times, especially in big projects. Therefore, the component-based system allows for speeding up the development process. While creating this specific dashboard, we built 20 components and spent 34 hours.

Click to Open Code Examples with Explanations

Getting Started

First of all, we need to create a new empty project. You can use any package manager, such as Yarn or npm. Also, we’ll need Vite, a tool for developing and building a project. Here are the commands we need:

Next, we need to delete these useless files:

  • src/App.css
  • src/assets/react.svg
  • public/vite.svg

Also, let’s remove all unnecessary stuff from the files src/App.tsx and src/index.css

Now, we can install the following third-party libraries :

To install them and also install type definitions for react-simple-maps, we can use the following commands:

With the dashboard before our eyes, we can understand what colors we need. Let’s create a file with some useful constants src/constants/index.ts where we can place them:

Now that all the preparations are over, we can start implementing the UI components. Code for each component is placed inside the src/components/ComponentName folder and consists of the following files:

  • ComponentName.tsx is the main file that contains the logic and the JSX markup of the component;
  • index.ts exports the component to allow other components to import it from a single entry point without having to specify the file extension or the exact file name;
  • styles.ts contains the styles.

In the examples below, we’ll provide the contents of the *.tsx files. You can download the complete source code using the link at the end of the React chapter to learn what other parts of code do.

Creating the Building Blocks for Larger Components

React doesn’t provide any ready-to-use widgets or controls. Before implementing the components for our dashboard, we must ensure that all the tiny building blocks, such as buttons and menus, are available. In this chapter, we’ll create these components that will eventually become integral parts of more complex ones.

ButtonIcon

We’ll need this component later to allow users to expand or collapse the sidebar. ButtonIcon is a button that displays the icon you pass to it.

MenuItem

MenuItem is a button that displays any passed icon and text and also has an option to determine whether it has a submenu. We’ll use it to implement the menu from the Sidebar and buttons at its bottom:

User

This component displays the user’s avatar, name, and role:

HeadItem

HeadItem is a button with title, active, and children parameters. If we don’t pass the title, the children will be displayed. The active parameter determines whether the button is active or not. We’ll use it to add menu items to the Header.

Total

The Total component displays the total number of anything you decide to count. In our case, it’ll be used to show the total number of projects or customers in corresponding components. It displays a number and text and also can include an extra block with any additional content:

Legend

This component explains the meaning of different chart elements. We’ll implement a basic LegendItem component that renders a circle with the required text. Then, we’ll use it in the Legend and LegendHorizontal components. The first is intended for components like the Gas component, whereas the second is a horizontal-oriented chart legend for charts like the Revenue component.

Text

It’s a simple component that displays the text. We will need it to sign the components’ names (e.g., Projects, Customers, Employees, etc.) and progress bars so that users can navigate the interface effortlessly:

Progress

 

The Progress component is a progress bar that displays the completion scale as a percentage. To implement it, we’ll need the Text component we created previously.

LeftRightSwitcher

LeftRightSwitcher is a slider that allows users to change displayed data by clicking the left or right button and correspondingly switching one year backward or forward:

Panel

The Panel component displays a panel with any content that we pass. We’ll use these panels as tiles to organize the layout of the dashboard body:

Building the Dashboard Layout with Sidebar and Header

Header

The Header component is the top part of the dashboard with the title and additional content:

Sidebar (Vue.js, Webix)

We can compose the Sidebar component from the components we’ve already created. We’ll need ButtonIcon, User, and MenuItem. Here’s how we make them work together:

Layout

Now that preparations are over, we can use these components to build a layout standard for all dashboard pages. Let’s create a new folder src/Layout with two files inside: styles.ts и index.tsx. In the last one, we’ll describe the part of the app similar for all pages that includes both Header and Sidebar:

Building the Dashboard Body Components

Projects (Vue.js, Webix)

To build the Projects component from the screenshot above, we’ll need the Progres component to display progress as a percentage, the Text component to display the name of this widget, and the Total component that counts the overall number of projects:

Employees (Vue.js, Webix)

Let’s think about what we’ll need to build this one. Obviously, the Text component to display this element’s name, and the Total component since here we count the number of employees according to different criteria. Also, we’ve implemented the ImagesStyled component to style a group of images and display them below each Total component:

Customers (Vue.js, Webix)

In addition to the Text and Total components we used earlier, here, we’ll also add a small table named CustomerTableStyled that displays the percentage of employees by country with flag icons to make shown info more intuitive:

Revenue (Vue.js, Webix)

Besides self-made components, we’ll also use Recharts, a third-party charting library we previously installed. With its help, we’ll create the AreaChart component and configure all its elements, such as axes, tooltips, etc.

Speaking of our own components, we’ll need Text, LegendHorizontal for horizontally-oriented chart legend, and LeftRightSwitcher to allow users to choose a specific year to display:

DugMeters (Vue.js, Webix)

We’ll use the Recharts library again, but it’ll be a different chart type this time. The BarChart is precisely what we need. Also, we’ll use the Text component and LegendHorizontal component since the chart legend has a horizontal orientation:

GasProduced (Vue.js, Webix)

We’ll need another third-party library to build this one. This time, we’ll rely on react-simple-maps to create a map. We’ll also use our own Legend component (not the horizontal one this time) and Text component.

OilProduced (Vue.js, Webix)

This component is pretty similar to the previous one, so we can follow the same pattern.

Composing the Dashboard Body

Now, we can build the dashboard body with all these components. Each of them will be placed within the Panel component we made earlier, and then we’ll compose a tiled interface from these panels. Let’s create a new folder src/pages and a new file Dashboard.tsx inside it, where we put all required code:

Next, we need to update the src/App.tsx file to put together header, sidebar, and dashboard body:

That’s it. The React dashboard is ready.

You can download the source code of this dashboard using the link below. To install all dependencies, use the yarn command. To run the project, use the yarn dev command.

Do you need to see the full project source code? Check the files compiled by our developers.

Vue.js Dashboard

One of the main Vue.js features is its component-based development approach. Also, it uses the SFC (Single-File Components) file format resulting in fewer files and less code compared to React. Nonetheless, nothing stops developers from splitting components into multiple files and creating a project structure similar to what React has. It depends on the prerequisites of a specific developer which way to choose. While building the dashboard with Vue.js, we created 13 components and 8 modules and spent 30 hours.

Click to Open Code Examples with Explanations

Getting Started

First, we need to create a new empty project using any package manager, such as Yarn or npm. Also, we’ll need Vite for developing and building the project:

Next, we can delete some files we don’t need:

  • src/assets/vue.svg
  • public/vite.svg
  • src/components/HelloWorld.vue

And edit the src/App.vue and src/index.css files to remove everything useless.

Some third-party libraries are also required:

  • Chart.js is a flexible JavaScript charting library;
  • vue-google-charts is a wrapper for Google Charts lib;
  • Sass is a preprocessor scripting language for more convenient work with the styles.

To install them, we can use the following commands:

At last, we can proceed with building the components that will become building blocks for larger app modules. Each of them is a separate file inside the src/components folder. For example, we’ll start with the src/components/ButtonIcon.vue file. Larger modules are placed within the src/module folder. For example, src/module/Customers.vue

Vue.js places both JavaScript and CSS code for a component inside a single file, and we’ll only focus on the JS part of the story. You can download the complete source code using the link at the end of the Vue.js chapter to learn what other parts of code do.

Creating Module Components

React doesn’t provide any ready-to-use widgets or controls. Before implementing the components for our dashboard, we must ensure that all the tiny building blocks, such as buttons and menus, are available. In this chapter, we’ll create these components that eventually will become the integral parts of more complex ones.

ButtonIcon

We’ll use this button to allow users to expand or collapse the sidebar. ButtonIcon is a button that displays the icon you pass to it and emits a ‘click’ event when clicked:

MenuItem

MenuItem is a button that displays a passed icon and text. It has an option to determine whether it has a submenu. We’ll use it to implement the menu from the Sidebar and buttons at its bottom:

User

The User component displays the user’s avatar, name, and role:

HeadItem

HeadItem is a button with title, active, and children parameters. If we don’t pass the title, the children will be displayed. The active parameter determines whether the button is active or not. We’ll use it to add menu items to the Header:

Total

The Total component displays the number and the caption. It can also include an additional block with any extra content. We’ll use it later in such modules as Projects and Customers, for example:

Legend

This component explains the meaning of info displayed in charts. We’ll implement a basic LegendItem component that renders a circle with the required text. Then, we’ll use it in the “regular” Legend and horizontal-oriented LegendHorizontal components:

Progress

 

The Progress component is a progress bar that displays the completion scale as a percentage:

LeftRightSwitcher

LeftRightSwitcher is a slider that allows users to change displayed data by clicking the left or right button and correspondingly switching one year backward or forward:

Panel

The Panel component displays a panel with any content that we pass to it. We’ll use these panels as tiles to organize the layout of the dashboard body:

Title

This component displays titles of bigger components, e.g. Customers, Employees, and others:

GeoChart

GeoChart is a wrapper with various settings for displaying the customized map. We’ll use it in such modules as as Gas and Oil later:

Building the Layout With Header and Sidebar

Header

This one represents the top part of the dashboard with the title and additional components:

Sidebar (React, Webix)

Sidebar is a module built from smaller components. Therefore, its course code is placed inside the src/module folder. For the Sidebar module, we’ll use such components as, ButtonIcon, MenuItem, and User:

Layout

Let’s create a new folder src/Layout with a file Main.vue inside. Here, we’ll describe the part of the application similar for all pages. It includes such elements as Header and Sidebar:

Building the Dashboard Modules Using the Created Components

Projects (React, Webix)

For this module, we’ll need the Progres component to display progress as a percentage, the Title component to display the module’s name, and the Total component that counts the overall number of projects:

Employees (React, Webix)

In addition to the Title and Total components, we’ll create the <div class=”emp__images”> container that iterates through the data array and renders tiny employee icons:

Customers (React, Webix)

Besides the components we’re already familiar with, here, we’ll also create the <div class=”cus__table”> container that iterates over each item in the customersData.data array to create a table that displays the percentage of customers by country with flag icons:

Revenue (React, Webix)

This chart’s legend has horizontal orientation, so we’ll need the LegendHorizontal component. Title will let users know what widget they’re looking at and LeftRightSwitcher will help them to choose a specific year to display. For the chart itself, we’ll use the Chart.js library:

DugMeters (React, Webix)

For this module, we’ll use the same set of components, but configure the chart differently since it displays different type of data:

GasProduced (React, Webix)

As you can see, this module shows a map. That’s what we need vue-google-charts for. We’ll also use our own Legend component (the vertical one) and TItle component:

OilProduced (React, Webix)

This component is pretty similar to the previous one, so we can follow the same pattern.

Composing the Dashboard Body

All the modules are ready, which means we can compose the dashboard body using them. Let’s create the src/pages folder with the file Dashboard.vue inside. There, we’ll import all the modules we’ve created, and put each of them within the Panel component. From these panels, we will build the Dashboard body:

The last step is to update the src/App.vue file:

The Vue.js dashboard is ready.

You can download the source code of the dashboard using the link below to try it yourself. To install dependencies, use the yarn command. To run the project, use the yarn dev command.

Do you need to see the full project source code? Check the files compiled by our developers.

Webix Dashboard

With Webix, it doesn’t require much effort since it provides access to ready-to-use components, including complex visualization widgets such as Chart and GeoChart. We spent 17 hours building the dashboard with this library.

Click to Open Code Examples with Explanations

Getting Started

We’ll use a demo app built with Webix Jet as a starting point. It’ll help us save some time since we won’t have to create the project structure for our solution manually. For example, we can download this jet-start demo from GitHub. It’ll give us a ready-to-use project structure, but there are some files we don’t actually need. Let’s delete everything from the views folder and create a new file named main.js inside. We’ll place all the code we need for building our dashboard’s side menu and header in this file. Now, we can start creating something.

Building the Sidebar (React, Vue.js)

The configuration for the widgets we will use is written in the config() method of the TopView class. This method returns the interface of the component that will be initialized. We’ll start from the top of the dashboard’s sidebar and implement all the elements one by one.

Logo and Button

Let’s build it as a layout with two columns. The first column uses the template widget, a non-editable area usually used for rendering plain text or a single data record. In our case, it’ll contain a logo. The second column has an inner layout consisting of three rows. The first and third of these rows are empty spacer components, while the second one contains the button control:

Admin Info

We’ll build this part of the dashboard solution using the template widget again. Notice that specifying the view type as “template” is optional in Webix, and the following code will work perfectly fine despite the differences with the previous example:

Hierarchical Menu

Here, we’ll use the sidebar widget from the Webix library. It allows for using menus with hierarchical structure in your software solutions. In the data property of the widget, we’ll pass data as an array of objects to be rendered as menu elements following the template described in the template property:

For navigation purposes, we’ll enable the menu within the init() method of the same class. This method specifies the component initialization behavior.

Check out the documentation page to learn more about the Webix Jet menu plugin.

Buttons at the Bottom

Three elements in this part of the dashboard will differ only in text and icon. Therefore, we can create a new method that will generate the buttons:

Next, we can describe the layout containing these buttons:

That’s it. The side menu for our software solution is ready!

Building the Dashboard Header

To build the dashboard header for our solution, we’ll need the template widget we’re already familiar with, the toolbar widget, and the tabbar widget. We’ll describe the layout consisting of three columns. The first two will contain the template widget with the required text. The third one will contain the tabbar widget working as a panel with clickable elements:

That’s all the code we need to build the header for our solution.

Building the Dashboard Body

We can use previously created elements to describe the main page structure:

In this code, we can see the object that contains the following: $subview: true. Subview is a component that can be settled within other components. We’ll place all the content of our page inside it.

Now, inside the views folder, let’s create a new folder named dashboard, where we’ll place all the components of the dashboard body. Inside, create the index.js file where we’ll describe the page structure. It’ll include the layout widget with the space type that comprises three rows, each of which will have a similar component. The first and third rows will contain three columns. The second row will contain another row inside.

Thanks to the Menu plugin, for this solution, we can describe the inner content of these rows and columns as  $subview: ‘file in the dashboard folder’. We can right away create files in the dashboard folder, each corresponding to the name of our solution’s component (e.g., projects.js, employees.js, customers.js, etc.):

Projects (React, Vue.js)

To build the Projects component of the dashboard solution, we’ll need the template widget and layout widget. In the projects.js file, let’s create a class Projects and describe the component header in its config() method:

Using the template widget, we can describe the inner part of this dashboard component consisting of two blocks. The first one will contain the text with a number, and the second one will contain text and state strings built based on incoming data:

We’ll use the models folder to allow our solution to store the data. Inside the folder, we can create the projectData.js file with the following code:

Since all required parts of this dashboard component are ready, we can describe the overall structure and implement the data parsing functionality in the init() method. For this, use the following code in the projects.js file:

That’s how we build the Projects component.

Employees (React, Vue.js)

The Employees component also looks pretty similar, so the code looks pretty much the same: You can use the same approach for building the Customers components, making the required adjustments to ensure they fit our solution and display the data correctly.

Customers (React, Vue.js)

You can use the same approach for building the Customers components, making the required adjustments to ensure they fit our solution and display the data correctly.

Revenue (React, Vue.js)

We can use the Webix chart widget to build the dashboard’s Revenue component. It can turn data into different chart types like line, spline, area, bar, pie, 3D-pie, donut, scatter, and radar.

Read Also Best JavaScript Libraries for Data Visualization (Featuring Webix and DHTMLX)

Let’s take a closer look at how this component displays the data:

As you can see, the top part contains a header that displays such data as the currently selected year and chart legend. We can build each of them using the template widget. Here’s the code from the revenue.js file that we need for this:

Next, we’ll use the chart widget with type: splineArea property to define the chart type that will be used for data visualization. Using xAxis and yAxis properties, we can define horizontal and vertical axes. We can add objects with value and color properties to describe our diagrams in the series property. According to the layout, we will use additional lines with the spline type to create the volumetric upper part of our diagram:

Finally, let’s gather all these components together:

DugMeters (React, Vue.js)

By implementing the DugMeters component, we start dealing with the dashboard elements’ bottom row. We can build it like the previous component using the Webix chart widget. However, our data type, in this case, differs from the previous example. Therefore, in this part of our solution, we can use the type: ‘bar’ property to use another chart type. Also, we can adjust the number of units being compared.

GasProduced (React, Vue.js)

For this part of our solution, we’ll use the GeoChart widget. It allows us to display the data related to different countries using Google GeoChart. Also, we should not forget about the header and chart legend:

The last step is to combine all the parts to build the component we need:

OilProduced (React, Vue.js)

This component has many similarities with the previous one. It looks the same and works with similar data. This circumstance allows us to implement it like the Gas Produced component with some extra widget configs.

That’s all we need to build the dashboard.

You can download the source code of our Webix solution using the link below. To run the demo, use the npm start command.

Do you need to see the full project source code? Check the files compiled by our developers.

Summing Up the Results

Above, you can see a graph showing relative performance when working with different libraries and hours spent implementing the dashboard. As you can see, creating it with React takes twice as long as with Webix. So, if you decided to develop a dashboard with Webix and started at the beginning of the week, it would be ready by the beginning of Wednesday. In the case of React, you would have to wait until Friday. Let’s find out where this difference comes from.

React doesn’t provide ready-to-use components. Luckily, plenty of third-party components, paid and free, were developed by many companies and enthusiasts. When building a React app, there’s always a choice between implementing a component from scratch and using the made solution. It’s natural to prefer the second option, but the initial impulse vanishes pretty quickly after you estimate how long it’ll take to customize such a solution. Plus, after the product release, you’ll have to customize the component again to adapt it to new functionality. And don’t forget about the bugs. There are always bugs. Spending resources on fixing them is another argument against using third-party components.

Usually, for each project, developers create new components from scratch, except when they need to use complex and standard ones, like grid or scheduler. Other types of components are usually built following the project requirements. That’s what happened in our case. We took three third-party libraries and made the remaining 20 components ourselves. As a result, we spent 34 hours on our React project.

Vue.js is similar to React in many aspects because it was one of the sources of inspiration for Vue.js creators. That’s why many features specific to React can also be found in Vue.js. For instance, Vue.js delivers no ready-to-use components, but you can choose paid or free third-party solutions. Once again, you must decide which option will work best for you.

With ready-made components, you can deliver the functional app faster to demonstrate to first customers or potential investors. But this path also brings multiple difficulties when fixing bugs or customizing something. You can’t escape this fate since all projects have bugs and change requests. Therefore, components are often written from scratch, except for complex and more or less standard ones, such as grids or Gantt charts. In our Vue.js project, we used two third-party components and wrote the remaining 21 components ourselves. As a result, we spent 30 hours, which is slightly less compared to React.

Webix provides access to a wide range of widgets. There’s more than enough to create our dashboard without installing third-party libraries. And since all widgets are supplied in one package, they are consistent and easy to work with. If the dashboard included, for example, a complex chart that can’t be found among Webix widgets, it would be necessary to use a third-party library like Highcharts.

The availability of many widgets significantly speeds up and simplifies the development process. Moreover, using Webix UI Designer simplifies app styling to suit project requirements. However, widget customization may still be necessary, and it can most effectively be carried out by the Webix library developers, which means us. All these features of Webix resulted in 17 hours of development time since no customization was required.

Conclusions

The speed and efficiency of building a project with a library that offers all the necessary components in one package are high. While React and Vue.js developers were still working on their components, the Webix developer had already done everything, took some coffee, and offered his ideas for expanding the dashboard functionality. Development speed is one of the most important criteria for choosing a specific technology for your project, but there are others you should consider. Only you know the complete list of all requirements and their importance for your project, so the final choice is yours. Our mission was to help you avoid choice overload as efficiently as possible. Contact us if you struggle to find a suitable library for your project.