@getgrass/components
v2.16.0
Published
Component library used by grass applications
Readme
Grass Components
Component library that is used by Grass applications
Installation
- This library depends on a couple of peer dependencies that needs to be installed for it to run. Make sure you have these dependencies installed first before using the components.
yarn add @chakra-ui/react @emotion/react @emotion/styled framer-motion react react-dom- Install the component library by running the command below.
yarn add @getgrass/components- Import the
themeand apply it on yourchakra-uiprovider
import theme from "@getgrass/components";
<ChakraProvider theme={theme}>{children}</ChakraProvider>;Adding fonts
- In order to apply the default font for this theme which is the
DM Sans, you need to install this:
yarn add @fontsource-variable/dm-san- Add the theme of the package
2.a. Import the font on your _app.tsx file
import theme from "@getgrass/components"
import '@fontsource-variable/dm-sans' //supports weights 100-900
...
const App = ({ Component, pageProps }: AppProps) => {
return (
<>
<ChakraProvider theme={theme}>
<Component {...pageProps} />
</ChakraProvider>
</>
)
}
export default App2.b. Extend the theme to a local theme
import { extendTheme } from "@chakra-ui/react";
import grassTheme from "@getgrass/components";
const theme = extendTheme(grassTheme, {
// insert local configurations here
});
export default theme;Common problems and fix
- New components added are not reflected on the app
- For NextJS apps, delete the
.nextfolder to remove cached components and run it again - Make sure you're installing the local package when developing
- For NextJS apps, delete the
