Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Javascript Library Articles
Page 12 of 18
Creating a QR Code of a link in React JS
In this article, we will see how to create a QR code of a link in React JS. A QR code is a two-dimensional barcode that is readable on smartphones. You must have seen QR codes on websites that you can scan which redirects you to a page. For example, to access WhatsApp from your laptop, you can go to "web.whatsapp.com" and then open WhatsApp on your phone and scan the given QR code.ExampleFirst create a React project −npx create-react-app tutorialpurposeGo to the project directory −cd tutorialpurposeInstall the qrcode.react package −npm i --save qrcode.reactThis library is going to help us ...
Read MoreCreating a Sky shader in React using React-Three-Fiber
In this article, we will see how to create a Sky shader in React JS using React-Three-Fiber. It will appear to look like original sky and it is really a great effect. Three.js is a cross-browser JavaScript library and application programming interface used to create and display animated 3D computer graphics in a web browser using WebGLExampleFirst install the following packages −npm i --save @react-three/fiber npm i --save @react-three/dreireact-three/fiber will be used as an intermediate between threejs and React.js and drei will be used to implement premade optimizable sky effect in it.Now, insert the following piece of code in App.js ...
Read MoreSVG morphing in React JS
SVG morphing is quite useful where you can morph SVG images with a beautiful animation which will look really great. It is a technique to give a transition between two SVG images when one SVG changes to another SVG.First create a React project −npx create-react-app tutorialpurposeGo to the project directory −cd tutorialpurposeExampleDownload and install the react-svg-morph package −npm install react-svg-morph --saveThis package will allow us to implement premade morphing animation to our SVGs.Add the following lines of code in App.js −import React from "react"; import ReactDOM from "react-dom"; import { MorphReplace } from "react-svg-morph"; class Checked extends React.Component { ...
Read MoreSVG drawing in React JS frontend
In this article, we will see how to create an interface on which a user can create drawings, write names, and pretty much any artistic work. You can use this feature to allow users to sign on a page. Here we will use the "react-hooks-svgdrawing" package.First create a React project −npx create-react-app tutorialpurposeGo to the project directory −cd tutorialpurposeExampleInstall the react-hooks-svgdrawing package −npm i --save react-hooks-svgdrawingThis library will be used to implement the container which will allow us to make a drawing or anything in the form of SVG using mouse or touchpad.Add the following lines of code in App.js ...
Read MoreSVG zoom-in and zoom-out in React JS
In this article, we will see how to zoom SVG images in React JS. It is really useful in some cases. We will use the react-svg-pan-zoom package to create a feature that will zoom-in or rotate our SVG image.First create a React project −npx create-react-app tutorialpurposeGo to the project directory −cd tutorialpurposeExampleInstall the react-svg-pan-zoom package −npm i --save react-svg-pan-zoomThis package will allow us to implement an area over which we can zoom-in and zoom-out and even rotate an image.Add the following lines of code in App.js −import React, { useRef, useEffect } from "react"; import { UncontrolledReactSVGPanZoom } from "react-svg-panzoom"; ...
Read MoreUsing pointer light for better lighting in React JS with React-Three-Fiber
In this article, we will see how to use a different type of light in react-three-fiber to make our objects look better. It will mainly act as a torch light that point toward an object. Three.js needs light to show colors, shadow effect, and many different kinds of effects.We will make a cube and then we will add the pointer light to it.ExampleFirst of all, install the following packages −npm i --save @react-three/fiber threethreejs and react-three/fiber will be used to add webGL renderer to the website and three-fiber will be used to connect threejs and ReactNow, insert the following lines ...
Read MoreCreating a PDF in React JS using plain CSS and HTML
In this article, we will see how to create a PDF using React JS. PDFs are versatile document formats which are used for various purposes like reporting, data sharing, data storage, etc. It is really a great help if we can a PDF in React through simple CSS.ExampleFirst create a React app −npx create-react-app pdfviewerInstall the react-pdf packagenpm i @react-pdf/renderer We will use this package to create a PDF inside our React frontend using DOM elements and CSS.Insert the following piece of code in in App.js −import React from "react"; import { Document, Page, Text, View, ...
Read MoreDevice Detection and Responsive Design in React JS
In this article, we will see how to render a page according to device but without using if-else clause. For this, we will use the react-device-detect package. This feature can help us create responsive webpages without using any media queries. So, let's get started.ExampleFirst create a React project −npx create-react-app tutorialpurposeGo to the project directory −cd tutorialpurpose Download the react-device-detect package −npm install react-device-detect --saveWe will use this package to add default media queries or default conditional rendering which are premade inside the package.Add the following lines of code in App.js −import { BrowserView, ...
Read MoreCreating a 3D Metal Texture Box in React using React-Three-Fiber
In this article, we will see how to make a metallic texture cubic box in React JS using React-Three-Fiber package. First, we will download a metallic photo and then we will apply it over all the surfaces of a cube. Cubes are basic shapes but we can make them look attractive by wrapping an image over its surfaces. So, let's get start.ExampleFirst download and install the following packages −npm i --save @react-three/fiber threethreejs and react-three/fiber will be used to add webGL renderer to the website and three-fiber will be used to connect threejs and React.Now let's download a metallic image ...
Read MoreDrag and Drop a File feature in React JS
Drag and Drop interfaces enable web applications to allow users to drag and drop files on a web page. In this article, we will see how an application can accept one or more files that are dragged from the underlying platform's file manager and dropped on a web page. Here, we will be using the react-dropzone package. Let's get started.ExampleFirst of all, create a React project −npx create-react-app newprojectGo to the project directory −cd newproject Now download and install the react-dropzone package −npm i --save react-dropzoneWe will use this library to add a droppable area inside our React element's area. ...
Read More