Develop
Install Casper UI and set it up in your application.
The Casper UI component library is built on top of Chakra UI, and provides a set of reusable React components that follow the Casper UI design system.
Installation
Section titled “Installation”To install Casper UI in React applications, use npm:
npm install @caspeco/casper-ui-libraryCSS only
Section titled “CSS only”For other applications, you can use the CSS only version, which provides the CSS variables but not the components.
npm install @caspeco/casper-ui-cssTo use the component library, you need to wrap your React application with a ThemeProvider (see Theming for more information). You can then import any of the components from the library and use them in your application.
import { ThemeProvider, Box } from "@caspeco/casper-ui-library";
function App() { return ( <ThemeProvider> <Box>Hello World</Box> </ThemeProvider> );}Below is a rendered example of how to use the Box component with some Theme variables:
import { Box, ThemeColor, ThemeRadius, ThemeSpace } from "@caspeco/casper-ui-library";
export default function Demo() { return ( <Box p={ThemeSpace.Large} bg={ThemeColor.Accent} borderRadius={ThemeRadius.Small} color={ThemeColor.OnAccent} > Your box children goes here </Box> );}