vivid
a JavaScript library which is built to easily customize and use the SVG Icons with a blaze.
Top Related Projects
A utility-first CSS framework for rapid UI development.
Modern CSS framework based on Flexbox
Materialize, a CSS Framework based on Material Design
The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.
A lightweight and modular front-end framework for developing fast and powerful web interfaces
A minimalist CSS framework.
Quick Overview
Vivid is a lightweight and customizable JavaScript library for creating interactive data visualizations. It provides a simple API for generating various types of charts and graphs, making it easy to integrate data visualization into web applications.
Pros
- Easy to use and integrate with existing projects
- Lightweight and performant, with minimal dependencies
- Highly customizable, allowing for unique and tailored visualizations
- Supports multiple chart types, including line, bar, and pie charts
Cons
- Limited documentation and examples compared to more established libraries
- Smaller community and ecosystem compared to popular alternatives like D3.js
- May lack some advanced features found in more comprehensive visualization libraries
- Limited browser compatibility information available
Code Examples
Creating a basic line chart:
const chart = new Vivid.LineChart({
container: '#chart-container',
data: [10, 20, 15, 25, 30],
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May']
});
chart.render();
Customizing a bar chart:
const chart = new Vivid.BarChart({
container: '#chart-container',
data: [15, 30, 25, 35, 20],
labels: ['A', 'B', 'C', 'D', 'E'],
colors: ['#ff6b6b', '#4ecdc4', '#45b7d1', '#f7d794', '#e77f67'],
animate: true
});
chart.render();
Creating a responsive pie chart:
const chart = new Vivid.PieChart({
container: '#chart-container',
data: [30, 40, 20, 10],
labels: ['Category 1', 'Category 2', 'Category 3', 'Category 4'],
responsive: true
});
chart.render();
Getting Started
- Include the Vivid library in your HTML file:
<script src="https://unpkg.com/@webkul/vivid/dist/vivid.min.js"></script>
- Create a container element for your chart:
<div id="chart-container"></div>
- Initialize and render a chart:
const chart = new Vivid.LineChart({
container: '#chart-container',
data: [10, 20, 30, 40, 50],
labels: ['A', 'B', 'C', 'D', 'E']
});
chart.render();
Competitor Comparisons
A utility-first CSS framework for rapid UI development.
Pros of Tailwind CSS
- Larger community and ecosystem with extensive documentation
- More flexible and customizable with a utility-first approach
- Better performance optimization with PurgeCSS integration
Cons of Tailwind CSS
- Steeper learning curve for developers new to utility-first CSS
- Can lead to longer class names and potentially cluttered HTML
Code Comparison
Vivid:
.button {
@include button($primary);
}
Tailwind CSS:
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Button
</button>
Summary
Tailwind CSS offers a more comprehensive and flexible approach to CSS, with a larger community and ecosystem. It provides better performance optimization but may have a steeper learning curve. Vivid, on the other hand, offers a more traditional CSS framework approach with pre-built components and a simpler learning curve. The choice between the two depends on project requirements, team expertise, and personal preferences.
Modern CSS framework based on Flexbox
Pros of Bulma
- More mature and widely adopted, with a larger community and ecosystem
- Extensive documentation and examples, making it easier to learn and use
- Modular architecture allows for easy customization and smaller file sizes
Cons of Bulma
- Less opinionated design, requiring more effort to create a unique look
- Lacks some advanced components and features found in Vivid
- May require additional JavaScript for certain interactive components
Code Comparison
Bulma:
@import "bulma/sass/utilities/_all"
@import "bulma/sass/base/_all"
@import "bulma/sass/elements/button"
@import "bulma/sass/elements/container"
@import "bulma/sass/elements/title"
Vivid:
@import "vivid/scss/vivid";
@import "vivid/scss/components/button";
@import "vivid/scss/components/container";
@import "vivid/scss/components/typography";
Both frameworks use a modular approach, allowing developers to import only the necessary components. Bulma's import structure is more granular, while Vivid's imports are more component-focused.
Bulma offers a more flexible and customizable foundation, making it suitable for a wide range of projects. Vivid, on the other hand, provides a more opinionated design system with pre-built components, which can be advantageous for rapid development but may require more effort to customize extensively.
Materialize, a CSS Framework based on Material Design
Pros of Materialize
- More mature and widely adopted framework with a larger community
- Extensive documentation and examples available
- Better browser compatibility, including support for older versions
Cons of Materialize
- Larger file size, which may impact page load times
- Less customizable out-of-the-box compared to Vivid
- Steeper learning curve for beginners due to more complex structure
Code Comparison
Materialize:
<div class="row">
<div class="col s12 m6">
<div class="card blue-grey darken-1">
<div class="card-content white-text">
<span class="card-title">Card Title</span>
<p>Card content</p>
</div>
</div>
</div>
</div>
Vivid:
<div class="vd-card">
<div class="vd-card-header">Card Title</div>
<div class="vd-card-body">
<p>Card content</p>
</div>
</div>
Both frameworks offer responsive design capabilities, but Materialize uses a more complex grid system with predefined classes, while Vivid opts for a simpler, more straightforward approach to card components.
The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.
Pros of Foundation
- More mature and established project with a larger community and ecosystem
- Extensive documentation and learning resources available
- Highly customizable with a modular architecture
Cons of Foundation
- Steeper learning curve due to its comprehensive feature set
- Larger file size, which may impact page load times
- More complex setup process compared to simpler alternatives
Code Comparison
Vivid (CSS custom properties):
:root {
--vvd-color-primary: #007bff;
--vvd-font-family: 'Arial', sans-serif;
}
Foundation (Sass variables):
$primary-color: #1779ba;
$body-font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
Both frameworks offer ways to customize styles, but Vivid uses modern CSS custom properties, while Foundation relies on Sass variables. Foundation's approach allows for more complex operations and mixins, but Vivid's method is native to CSS and doesn't require preprocessing.
Foundation provides a more comprehensive set of pre-built components and utilities, making it suitable for larger, more complex projects. Vivid, on the other hand, focuses on simplicity and modern CSS features, which may be preferable for smaller projects or developers who want more control over their styling approach.
A lightweight and modular front-end framework for developing fast and powerful web interfaces
Pros of UIkit
- More comprehensive and feature-rich UI framework
- Larger community and better documentation
- Regular updates and active maintenance
Cons of UIkit
- Larger file size and potentially slower load times
- Steeper learning curve due to more components and options
- Less customizable without extensive overrides
Code Comparison
UIkit:
<div class="uk-card uk-card-default">
<div class="uk-card-header">
<h3 class="uk-card-title">Title</h3>
</div>
<div class="uk-card-body">
<p>Content</p>
</div>
</div>
Vivid:
<div class="vvd-card">
<div class="vvd-card__header">
<h3 class="vvd-card__title">Title</h3>
</div>
<div class="vvd-card__body">
<p>Content</p>
</div>
</div>
UIkit offers a more extensive set of pre-built components and utilities, making it suitable for larger projects with diverse UI requirements. However, this comes at the cost of a larger file size and potentially more complex implementation.
Vivid, on the other hand, provides a lighter-weight solution with a focus on simplicity and ease of use. It may be more suitable for smaller projects or those requiring a more minimalist approach to UI design.
Both frameworks use similar class-based structures for their components, but UIkit tends to have more modifier classes and options available out of the box.
A minimalist CSS framework.
Pros of Milligram
- Extremely lightweight (2kb gzipped) compared to Vivid's larger footprint
- Simpler, more minimalist design philosophy
- Better documentation and examples
Cons of Milligram
- Less feature-rich than Vivid
- Fewer pre-built components and utilities
- Limited customization options out of the box
Code Comparison
Milligram:
.button,
button,
input[type='button'],
input[type='reset'],
input[type='submit'] {
background-color: #9b4dca;
border: 0.1rem solid #9b4dca;
border-radius: .4rem;
color: #fff;
cursor: pointer;
display: inline-block;
font-size: 1.1rem;
font-weight: 700;
height: 3.8rem;
letter-spacing: .1rem;
line-height: 3.8rem;
padding: 0 3.0rem;
text-align: center;
text-decoration: none;
text-transform: uppercase;
white-space: nowrap;
}
Vivid:
.vvd-btn {
display: inline-flex;
align-items: center;
justify-content: center;
font-weight: 500;
text-align: center;
white-space: nowrap;
vertical-align: middle;
user-select: none;
border: 1px solid transparent;
padding: 0.375rem 0.75rem;
font-size: 1rem;
line-height: 1.5;
border-radius: 0.25rem;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Check Beautiful Doc on Website.
Introduction
Vivid.JS is an SVG Icons library which can be used to add highly customizable vibrant icons to the DOM without any dev dependencies.
Vivid.JS is easy to adapt and can bring SVG icons to life using html5 data attributes on the go. Icons can also be individually customized in terms of colors and size using html5 data attributes which gives more power to Vivid.JS library.
Vivid.JS SVG Icons ca be download and customized as per needs in different designing softwares like Photoshop and Sketch as well.
Download Vivid.JS Icons for Sketch
Download Vivid.JS Icons for Photoshop
Getting Started
To get started with Vivid.JS, you just need to include vivid-icons.min.js
to your project.
Installation
Compiled vivid-icons.min.js JavaScript minified file can be directly linked from jsDelivr or UNPKG CDN or Vivid.JS can be included within your workflow using your favorite package managers as well.
Link from jsDelivr (Recommended)
or UNPKG CDN
You can include Vivid Icons JavaScript file in the header section of your document as shown below -
<script src="https://cdn.jsdelivr.net/npm/vivid-icons@1.0.10" type="text/javascript"></script>
or
<script src="https://unpkg.com/vivid-icons@1.0.10" type="text/javascript"></script>
Package Managers
You can use either npm, yarn or bower to get the Vivid.JS package
Copy and Paste the command below in your terminal to get package with npm -
npm install vivid-icons
Copy and Paste the command below in your terminal to get package with yarn -
yarn add vivid-icons
Copy and Paste the command below in your terminal to get package with bower -
bower install vivid-icons
Usage
Including icons with Vivid.JS is very easy and quick to use.
Using an Icon
An SVG Icon can be easily included using the syntax <i data-vi="icon-name"></i>
, where icon-name
is replaced by the unique name of the respective icon.
Example Code
<i data-vi="doc"></i>
Customizing Icon Size
To customize the size of the respective icon, Add data-vi-size="number"
data attribute to i
element to customize size of the icon.
Example Code
<i data-vi="doc" data-vi-size="96"></i>
Customizing Icon Colors
Each Vivid Icon has upto three colors which are primary
, accent
and prop
. Each color can be customized respectively using data attributes.
Add data-vi-primary="#hexcode"
data attribute to customize the primary color of the icon.
Add data-vi-accent="#hexcode"
data attribute to customize the accent color of the icon.
Add data-vi-prop="#hexcode"
data attribute to customize the prop color of the icon.
Example Code
<i data-vi="doc" data-vi-primary="#2B13C1" data-vi-accent="#00ECB1" data-vi-prop="#CEFAFF"></i>
Icon Customization
Oh! Yes, You can customize the default size and colors of the Vivid.JS
SVG Icons Library.
Install Node.js
First of all you need to install the latest version of Node.js (if you don't have it pre-installed), once you are over with Node.js installation, open up terminal and verify everything has setup correctly by running npm -v
and it should return with something like 5.x.x
Create your Project
- Open terminal and create your project directory with
mkdir project-name
command. - Go to your project directory using
cd project-name
command. - Initialize your project by
npm init
command and enter the necessary details.
Install Vivid.JS Package
Install Vivid.JS SVG Icons Package with npm package manager using the command below -
npm install vivid-icons
Once, the vivid-icons is installed as a node module, go to node_modules/vivid-icons directory using cd node_modules/vivid-icons
command and install vivid-icons dependencies with npm install
.
Customize Icons
Go to src
directory of the installed package and open config.js
file.
config.js
file looks like
export let iconConfig = {
size: "48",
primaryColor: "#FF6E6E",
accentColor: "#0C0058",
propColor: "#FFFFFF"
}
Update the respective property values which needs to be changed.
Compile Vivid.JS Icons
Once you are done with updates in config.js
head back to the terminal and run the following command -
npm run build
Voila! You're done
Once the compilation process is over, your browser will fire up to show the compiled Vivid SVG Icons in your browser from the ./dist/preview.html
file.
If you are using Windows environment replace the "open-html": "open ./dist/preview.html"
with "open-html": "show ./dist/preview.html"
in package.json
file.
Adding Icons
If you wish to create your very own Vivid.JS with your custom icons, Follow the steps below -
Once you have installed Vivid.JS, add/replace/remove
the icons from ./icons
directory
Make sure the SVG Icons which has been added must have vi-primary
and vi-accent
class to the respective SVG Elements, so that the colors can be customized later from src/config.js
.
Example Code
<svg id="chat" xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
<defs>
<style>
.vi-primary {
fill: #ffb400;
}
.vi-accent {
fill: #070c2b;
}
</style>
</defs>
<path class="vi-primary" d="M24,39.765A18.556,18.556,0,0,1,13.924,37.1L7,44V23.882l0.012,0.006C7.011,23.791,7,23.7,7,23.6,7,14.369,13.247,8,24,8s17,6.652,17,15.882S34.753,39.765,24,39.765Z"/>
<path class="vi-accent" d="M31.994,20.99a3,3,0,1,1-3,3A3,3,0,0,1,31.994,20.99ZM24,21a3,3,0,1,1-3,3A3,3,0,0,1,24,21Zm-8,0a3,3,0,1,1-3,3A3,3,0,0,1,16,21Z"/>
</svg>
Go to the root directory of vivid-icons
and execute npm run build
command from terminal.
Credits
© Copyright 2018 Webkul Software, All rights reserved.
Top Related Projects
A utility-first CSS framework for rapid UI development.
Modern CSS framework based on Flexbox
Materialize, a CSS Framework based on Material Design
The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.
A lightweight and modular front-end framework for developing fast and powerful web interfaces
A minimalist CSS framework.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot