Add pre-built Chakra UI components to a Gatsby app

Kyle Gill
InstructorKyle Gill

Share this video with your friends

Send Tweet
Published 2 years ago
Updated 2 months ago

Chakra UI provides a set of high level, accessible components for building with React. You can add support for Chakra UI to a Gatsby app by installing and configuring a plugin. By using these components you can get up to speed with some pre-built options for common needs without having to reinvent the wheel.

Additional resources:

Kyle Gill: [0:01] In an existing Gatsby site, I'm using the Hello World starter. Install Gatsby plugin Chakra UI with NPM or yarn, as well as its necessary dependencies, @chakra-ui/core, @emotion/core, @emotion/styled, and emotion-theming.

[0:19] Gatsby needs to be aware of the installed plugin, so navigate to your Gatsby config and add the plugin to the plugins array.

[0:30] Now, when you run Gatsby develop, the plugins code will run, wrapping your site in a necessary theme providers Chakra UI users.

[0:39] You can now import components from Chakra UI, like a button, and use them anywhere throughout your app.