Chakra UI

0
11K

What is Chakra UI?

Have you ever struggled with whether to focus more on the back-end or front-end of your project? Well believe me, both are equally important.

I started using Chakra UI because I wanted to focus on my back-end code more than being stuck on "How to center a div element?".

Chakra UI is extremely simple to use, especially when you are familiar with how to use ReactJs components.

How to Get Started and Install Chakra UI

Inside your respective directory, install ChakraUI using Yarn or NPM

yarn add @chakra-ui/react @emotion/react@^11 @emotion/styled@^11 framer-motion@^4

npm i @chakra-ui/react @emotion/react@^11 @emotion/styled@^11 framer-motion@^4

For React:

For ChakraUI to get initialised you first need to add <ChakraProvider> in your index.js file.

import React from "react"

// 1. import `ChakraProvider` component
import { ChakraProvider } from "@chakra-ui/react"

function App({ Component }) {
 // 2. Use at the root of your app
 return (
   <ChakraProvider>
     <Component />
   </ChakraProvider>
 )
}

For Next.js

Go to pages/_app.js and add the following lines of code:

import { ChakraProvider } from "@chakra-ui/react"
function MyApp({ Component, pageProps }) {
 return (
   <ChakraProvider>
     <Component {...pageProps} />
   </ChakraProvider>
 )
}
export default MyApp
Căutare
Categorii
Citeste mai mult
Financial Services
The tradeoff between economic output and environmental protection
Key points Depending on their income levels and political preferences, different...
By Mark Lorenzo 2023-07-28 20:15:43 0 236K
Business
What is Google Analytics 4 (GA4)?
Google Analytics 4, commonly referred to as GA4, is Google’s latest analytics platform that...
By Dacey Rankins 2025-09-01 09:24:11 0 3K
Social Issues
Gifted. (2017)
Frank, a single man raising his child prodigy niece Mary, is drawn into a custody battle with his...
By Leonard Pokrovski 2023-05-18 19:45:37 0 33K
Science Fiction and Fantasy
The Super Mario Bros. Movie. (2023)
A plumber named Mario travels through an underground labyrinth with his brother, Luigi, trying to...
By Leonard Pokrovski 2023-06-11 14:29:44 0 30K
Business
Product marketing: what is it and why is it needed in IT  
Product marketing: what is it and why is it needed in IT   Launching a new product on...
By Leonard Pokrovski 2024-08-28 21:41:43 0 21K

BigMoney.VIP Powered by Hosting Pokrov