Found 8591 Articles for Front End Technology

How to set Parent State from Children Component in ReactJS?

Shubham Vora
Updated on 26-Oct-2023 02:29:41

38K+ Views

In ReactJS, we can set the state in the child component by passing the values as a prop of the child component. Sometimes, we require to set the state from the children component to the parent component in ReactJS. We can create a state handler function in the parent component and pass it as a prop of the child component. After that, we can use the child component function to set the parent component's state. In such a way, we can manage the state of the parent component from the child component. Set parent state from children component in functional ... Read More

How to change background-color on a specific wider viewport in CSS ?

Devesh Chauhan
Updated on 27-Feb-2023 14:51:27

1K+ Views

The method through which we can determine the device being used for surfing is by using what we call, “viewport” widths. In computer graphics, a viewport usually indicates the polygonal (often rectangular) area that is now being viewed by user. When we talk about viewports in a web browser, we usually mean a window on which the content is visible and outside of which the user cannot view the content. There are basically two types of viewports. The viewport that is fixed and onto which the browser draws the whole web page is called the layout viewport. ... Read More

How to set focus on an input field after rendering in ReactJS?

Shubham Vora
Updated on 27-Feb-2023 12:07:59

11K+ Views

While working with the forms in React, sometimes we may require to focus on any input. For example, we want to enable the submit button only if the user enters some text in the input field. In such cases, we can focus on the input so that users know that they have to enter some text in the input field to enable the button. In this tutorial, we will learn multiple ways to focus on the input field after rendering in ReactJS. Use the autoFocus attribute with the input field We can use the autofocus attribute in HTML to focus ... Read More

How to send one or more files to an API using axios in ReactJS?

Shubham Vora
Updated on 27-Feb-2023 12:05:46

1K+ Views

ReactJS is a frontend library, so we can use it to create web pages. It’s natural to show data in real-time applications, and the backend manages it. So, whenever React needs data to show on the web page, it gets it from the backend by making API calls. Sometimes, we may require to send data to the backend to store it in the database. For example, we have taken the user’s profile image and need to send it to the backend to store it in the database. In many cases, we require to send single or multiple files to ... Read More

How to set cursor style that indicates any direction scroll using CSS ?

Devesh Chauhan
Updated on 27-Feb-2023 14:50:32

498 Views

Before moving onto the topic, let us try to understand the importance of cursor as an UI element. We know that the very first thing a user interacts with in a website is mostly the cursor, this is why manipulating the cursor style and effects is the most important for designing, as it greatly contributes to the overall user experience. The cursor property is used to set the mouse cursor to appear whenever we hover over an element by pointing over it. It is applied to all the elements and is inheritable, meaning the child element will also have the ... Read More

How to set the table layout algorithm using CSS ?

Devesh Chauhan
Updated on 27-Feb-2023 14:49:38

340 Views

In order to answer the question: “How to set the table layout algorithm using CSS”, we need to understand what is ‘layout’. A layout in HTML specifies the fundamental organization and visual style of a website. It gives you the ability to build websites with basic HTML tags. Table Layout Table layout is one of the least advised HTML layouts due of its complexity. As its name suggests, it is based on the table> element. The table> element allows you to arrange data in rows and columns. The table> tag is a container tag, since it serves as ... Read More

How to create Menu Item Component in ReactJS?

Shubham Vora
Updated on 27-Feb-2023 12:01:53

7K+ Views

The Menu item component shows users various menu options, and they can select any option from the menu item component. The menu item component in React Js is similar to the element in HTML, or we can say it is a dropdown menu. Also, menu components contain a submenu to show multiple options for any menu item. Developers should use the HTML tag to implement menu item components from scratch. However, many React libraries available on the internet provide pre-designed Menu item components. So, we will use different libraries to build the menu item components below. Use ... Read More

How hovering over a division element to gradually change the width in CSS ?

Devesh Chauhan
Updated on 27-Feb-2023 14:48:04

817 Views

Whenever we want to gradually change the style of an element from one form of styling to some another style, whether it may be some interaction from user or through duration of stay on the site. You can use animations to change a lot of styles for any duration of time. Let us look at the properties that you need for animations. Keyframes − This is used to specify an animation for an element. It contains the changes that will occur to the style of the element. The element then moves from the style at the beginning to ... Read More

Difference between -webkit-box-shadow & box-shadow in CSS

Devesh Chauhan
Updated on 27-Feb-2023 14:45:57

821 Views

As we already know that CSS provides us with a wide range of properties and pseudoclasses, which enables developers to add the desired styling to the element. One such property is box shadow property; it allows us to add a shadow like effect around the element. Box-shadow Property Box shadow is a CSS property used to create an outer or inner shadow effect on elements. It applies one or more shadows to the element, each of which is specified with X and Y offsets from the element, blur radius, spread radius, color and opacity value. The box-shadow property ... Read More

How to create Instagram Like button in ReactJS?

Shubham Vora
Updated on 27-Feb-2023 11:58:18

2K+ Views

Most of all, you have used Instagram and have looked at the Like button given below every post. There are two things to notice about Instagram Like button: one is its shape is a heart shape which we need to create, and another is it fills up with red colour when we Like someone's post. There are two different ways to create Instagram Like button. One is created from scratch using CSS and JavaScript, and another uses two different icons. One is filled, and another is outlined. Use the Material UI library We will use the FormControlLabel component from the ... Read More

Advertisements