![]() |
Chakra UI Typography Heading Component is used to display headings around the web application. Internally, the Heading Component renders HTML heading tags which can be customized using the as prop of the Heading Component. The as prop take values h1, h2, h3, h4, h5 and h6. Additionally, we can change the size of the rendered heading using the size prop and provide the size value to it. The value of the size prop can be overridden by the fontSize prop. Prerequisites:Approach:We will create Heading tags by passing different values of the as and the size props. We will also use the fontSize prop to change the size of the heading according to our needs. Steps to Create React Application and Installing Chakra UI:Step 1: Create a react application using the create-react-app. npx create-react-app my-chakraui-app
Step 2: Move to the created project folder (my-chakraui-app). cd my-chakraui-app
Step 3: After Creating the react app install the needed packages using below command npm i @chakra-ui/react @emotion/react@^11 @emotion/styled@^11 framer-motion@^6
Project Structure:The updated dependencies in the package.json file are: "dependencies": { Example: Below are the code snippets for the respective files. Javascript
Javascript
Start your application using the following command. npm start
Output: Go to http://localhost:3000 in your browser to see the live app |
Reffered: https://www.geeksforgeeks.org
ReactJS |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 15 |