
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
gatsby-plugin-chakra-ui
Advanced tools
🚨 Chakra v0 is no longer supported and this plugin is likely broken! Please upgrade to Chakra UI v1 and use @chakra-ui/gatsby-plugin
instead. Visit https://chakra-ui.com/ for more information. 🚨
Drop-in Chakra UI support for Gatsby sites
⚡ To use Chakra UI in your Gatsby site, you need to install the plugin and its peer dependencies.
$ yarn add gatsby-plugin-chakra-ui @chakra-ui/core @emotion/core @emotion/styled emotion-theming
gatsby-plugin-chakra-ui
as a plugin in your Gatsby config.// gatsby-config.js
module.exports = {
plugins: ["gatsby-plugin-chakra-ui"],
};
// src/pages/index.js
import React from "react";
import { Box, Text } from "@chakra-ui/core";
function IndexPage() {
return (
<Box p={8}>
<Text fontSize="xl">Hello World</Text>
</Box>
);
}
export default IndexPage;
By default, this plugin makes use of Chakra CSS reset component and color mode context:
<ThemeProvider theme={theme}>
<CSSReset />
<ColorModeProvider>{element}</ColorModeProvider>
</ThemeProvider>
You can disable either of these with Gatsby options:
// gatsby-config.js
module.exports = {
plugins: [
{
resolve: "gatsby-plugin-chakra-ui",
options: {
/**
* @property {boolean} [isResettingCSS=true]
* if false, this plugin will not use `<CSSReset />
*/
isResettingCSS: true,
/**
* @property {boolean} [isUsingColorMode=true]
* if false, this plugin will not use <ColorModeProvider />
*/
isUsingColorMode: true,
},
},
],
};
To use custom theme, you can shadow this plugin's theme.js
file with your own
theme:
// src/gatsby-plugin-chakra-ui/theme.js
const theme = {};
export default theme;
You can learn more about custom theme at Chakra UI's documentation.
By default, Chakra provides a sensible default theme inspired by Tailwind CSS.
FAQs
Drop-in Chakra UI support for Gatsby sites
The npm package gatsby-plugin-chakra-ui receives a total of 117 weekly downloads. As such, gatsby-plugin-chakra-ui popularity was classified as not popular.
We found that gatsby-plugin-chakra-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.