# VividJS **Repository Path**: mirrors/VividJS ## Basic Information - **Project Name**: VividJS - **Description**: Vivid.js 是一套开源 SVG 图标库,可以使用它轻松定制和使用 SVG 图标 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 2 - **Created**: 2018-06-12 - **Last Updated**: 2025-10-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ![Vivid.JS Logo](https://webkul.github.io/vivid/assets/res/vivid-logo.svg) ### Check [Beautiful Doc](https://webkul.github.io/vivid/docs.html) 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](https://bit.ly/vivid-sketch) Download Vivid.JS Icons for [Photoshop](https://bit.ly/vivid-ps) # 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](https://www.jsdelivr.com/) or [UNPKG](https://unpkg.com/#/) 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 - ```html ``` or ```html ``` ## 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 - ```cli npm install vivid-icons ``` Copy and Paste the command below in your terminal to get package with yarn - ```cli yarn add vivid-icons ``` Copy and Paste the command below in your terminal to get package with bower - ```cli 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 `` , where `icon-name` is replaced by the unique name of the respective icon. ### Example Code ```html ``` ## 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 ```html ``` ## 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 ```html ``` # 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](https://nodejs.org/en/) (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 - ```cli 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 ```javascript 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 - ```cli 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](#install-vividjs-package), `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](https://developer.mozilla.org/en-US/docs/Web/SVG/Element), so that the colors can be customized later from `src/config.js`. ### Example Code ```html ``` Go to the root directory of `vivid-icons` and execute `npm run build` command from terminal. # Credits © Copyright 2018 [Webkul Software](https://webkul.com), All rights reserved.