Chakra UI is a component system for building products with speed ⚡️
Installations
npm install @chakra-ui/system
Developer Guide
Typescript
Yes
Module System
CommonJS, ESM
Node Version
18.18.2
NPM Version
9.8.1
Score
90.7
Supply Chain
92.5
Quality
77.6
Maintenance
100
Vulnerability
99.3
License
Releases
@chakra-ui/react@3.5.1
Published on 24 Jan 2025
@chakra-ui/panda-preset@3.5.1
Published on 24 Jan 2025
@chakra-ui/cli@3.5.1
Published on 24 Jan 2025
@chakra-ui/react@3.5.0
Published on 24 Jan 2025
@chakra-ui/panda-preset@3.5.0
Published on 24 Jan 2025
@chakra-ui/cli@3.5.0
Published on 24 Jan 2025
Contributors
Languages
TypeScript (82.79%)
MDX (16.4%)
JavaScript (0.66%)
CSS (0.08%)
HTML (0.07%)
Developer
Download Statistics
Total Downloads
81,381,198
Last Day
96,078
Last Week
417,016
Last Month
1,881,502
Last Year
29,236,657
GitHub Statistics
38,408 Stars
10,418 Commits
3,346 Forks
202 Watching
11 Branches
675 Contributors
Bundle Size
220.12 kB
Minified
59.69 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.6.2
Package Id
@chakra-ui/system@2.6.2
Unpacked Size
152.22 kB
Size
25.77 kB
File Count
87
NPM Version
9.8.1
Node Version
18.18.2
Publised On
09 Nov 2023
Total Downloads
Cumulative downloads
Total Downloads
81,381,198
Last day
-3.3%
96,078
Compared to previous day
Last week
-16%
417,016
Compared to previous week
Last month
-2%
1,881,502
Compared to previous month
Last year
12.3%
29,236,657
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
7
Peer Dependencies
3
@chakra-ui/system
Styled API for creating atomic, theme-aware component styling.
Installation
1yarn add @chakra-ui/system 2 3# or 4 5npm i @chakra-ui/system
Problem
In modern web development, we have lots of solutions and architectures that have tried to unify how components are styled. We've seen CSS architectures like BEM, SMACSS, etc, and frameworks like theme-ui, and Tailwind CSS.
While these solutions work great, we still think there is a sheer amount of work required to create a fully customizable, theme-aware component.
Solutions
Chakra Elements
Chakra provides enhanced JSX elements that can be styled directly via props, or
can accept the common sx
prop for custom styles.
We'll provide a chakra function, just like styled-components. Users can create
any component using the chakra.[element]
. The resulting component will be a
styled component and have all system props.
1<chakra.button bg="green.200" _hover={{ bg: "green.300" }}> 2 Click me 3</chakra.button> 4 5<chakra.h1 fontSize="lg"> Heading </chakra.h1> 6 7// create your own box 8const Box = chakra.div 9 10// you can still use the `as` prop 11<Box as="h1">This is my box</Box> 12 13// for custom components 14const ChakraPowered = chakra(YourComponent) 15 16// TS: chakra will infer the types of Link and 17// make it available in props 18<chakra.a as={Link} to="/home"> Click me</chakra.a>
Chakra Component API
A way to define themeable components in chakra. We believe most re-usable, atomic components have the following modifiers:
- Size: It has different size variations (small, medium, large)
- Variant: It has different visual style (outline, solid, ghost)
- Color scheme (Optional): For a given variant, it can have several color scheme. For example, an outline button with a red color scheme.
- Color mode (Optional): Components also change their visual styles based on the user preferred color mode (light or dark)
Our goal with this component API is to design a common interface to style any component given these characteristics. Here's how it works:
1// 1. create a component schema in your theme 2const theme = { 3 colors: { 4 green: { 5 light: "#dfdfdf", 6 normal: "#dfdfdf", 7 dark: "#d566Df", 8 darker: "#dfd56f" 9 }, 10 blue: {} 11 }, 12 components: { 13 Button: { 14 defaultProps: { 15 variant: "solid", 16 size: "md", 17 colorScheme: "blue" 18 }, 19 variants: { 20 // props has colorScheme, colorMode (light mode or dark mode) 21 solid: props => ({ 22 bg: `${props.colorScheme}.normal`, 23 color: "white", 24 }), 25 outline: { 26 border: "2px", 27 borderColor: "green.normal" 28 } 29 }, 30 sizes: { 31 sm: { 32 padding: 20, 33 fontSize: 12 34 }, 35 md: { 36 padding: 40, 37 fontSize: 15 38 } 39 } 40 } 41 } 42}; 43 44// 2. create or import Button from chakra-ui 45import { Button } from "@chakra-ui/react" 46 47// or your own button 48const Button = chakra("button", { themeKey: "Button" }) 49 50// 3. use the button. It'll have the visual props defined in defaultProps 51<Button>Click me</Button> 52 53// 4. override the defaultProps 54<Button variant="outline" colorScheme="green">Click me</Button>
No vulnerabilities found.
Reason
30 commit(s) and 13 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
no binaries found in the repo
Reason
5 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-c76h-2ccp-4975
Reason
Found 7/21 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: topLevel 'actions' permission set to 'write': .github/workflows/issue-stale.yml:10
- Warn: no topLevel permission defined: .github/workflows/pkg-pr.yml:1
- Warn: no topLevel permission defined: .github/workflows/quality.yml:1
- Warn: no topLevel permission defined: .github/workflows/release.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/issue-stale.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/issue-stale.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pkg-pr.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/pkg-pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pkg-pr.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/pkg-pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/quality.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/quality.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/quality.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/quality.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/quality.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/quality.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/quality.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/quality.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/quality.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/quality.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/release.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/chakra-ui/chakra-ui/release.yml/main?enable=pin
- Info: 0 out of 10 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 16 are checked with a SAST tool
Score
4.6
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to @chakra-ui/system
@chakra-ui/styled-system
Style function for css-in-js building component libraries
@chakra-ui/provider
Theme and components agnostic ChakraProvider
@chakra-ui/react
Responsive and accessible React UI components built with React and Emotion
@chakra-ui/vue-system
Chakra UI Vue | System module