Chakra UI is a component system for building products with speed ⚡️
Installations
npm install @chakra-ui/button
Developer Guide
Typescript
Yes
Module System
CommonJS, ESM
Node Version
18.16.1
NPM Version
9.5.1
Score
90.8
Supply Chain
90.6
Quality
77.6
Maintenance
100
Vulnerability
99.3
License
Releases
@chakra-ui/react@3.8.0
Updated on Feb 09, 2025
@chakra-ui/panda-preset@3.8.0
Updated on Feb 09, 2025
@chakra-ui/cli@3.8.0
Updated on Feb 09, 2025
@chakra-ui/panda-preset@3.7.0
Updated on Feb 04, 2025
@chakra-ui/react@3.7.0
Updated on Feb 04, 2025
@chakra-ui/cli@3.7.0
Updated on Feb 04, 2025
Contributors
Languages
TypeScript (82.72%)
MDX (16.47%)
JavaScript (0.65%)
CSS (0.08%)
HTML (0.07%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
74,813,297
Last Day
15,671
Last Week
447,724
Last Month
1,819,148
Last Year
26,031,818
GitHub Statistics
MIT License
38,512 Stars
10,472 Commits
3,356 Forks
202 Watchers
11 Branches
682 Contributors
Updated on Feb 16, 2025
Bundle Size
9.04 kB
Minified
2.86 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.1.0
Package Id
@chakra-ui/button@2.1.0
Unpacked Size
125.10 kB
Size
18.27 kB
File Count
62
NPM Version
9.5.1
Node Version
18.16.1
Published on
Jul 18, 2023
Total Downloads
Cumulative downloads
Total Downloads
74,813,297
Last Day
-23.8%
15,671
Compared to previous day
Last Week
1.3%
447,724
Compared to previous week
Last Month
25.8%
1,819,148
Compared to previous month
Last Year
9.3%
26,031,818
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
4
Peer Dependencies
2
Button
Buttons are used as triggers for actions. They are used in forms, toolbars, dialog footers and as stand-alone action triggers.
Installation
1yarn add @chakra-ui/button 2 3# or 4 5npm i @chakra-ui/button
Import component
1import { Button } from "@chakra-ui/button"
Usage
1<Button colorScheme="green">Button</Button>
Button Sizes
Use the size
prop to change the size of the button. You can set the value to
xs
, sm
, md
, or lg
.
1<Stack>
2 <Button size="xs">Button</Button>
3 <Button size="sm">Button</Button>
4 <Button size="md">Button</Button>
5 <Button size="lg">Button</Button>
6</Stack>
Button Variant
Use the variant
prop to change the visual style of the Button. You can set the
value to solid
, ghost
, outline
, or link
.
1<ButtonGroup> 2 <Button variant="solid">Button</Button> 3 <Button variant="outline">Button</Button> 4 <Button variant="ghost">Button</Button> 5 <Button variant="link">Button</Button> 6</ButtonGroup>
Button with Icon
You can add left and right icons to the Button components.
1<ButtonGroup> 2 <Button leftIcon={<EmailIcon />} variant="solid"> 3 Email 4 </Button> 5 <Button rightIcon={<ArrowForwardIcon />} variant="outline"> 6 Call us 7 </Button> 8</ButtonGroup>
Button loading state
Pass isLoading
prop to the Button component to show its loading state. You can
optionally pass loadingText
prop.
You can also use a custom spinner to render your own spinner component.
1<Stack> 2 <Button isLoading colorScheme="teal" variant="solid"> 3 Email 4 </Button> 5 6 <Button 7 isLoading 8 colorScheme="teal" 9 variant="outline" 10 spinner={<BarSpinner />} 11 > 12 Submit 13 </Button> 14</Stack>

No vulnerabilities found.
Reason
30 commit(s) and 11 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
7 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-67mh-4wv8-2f99
- 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
- Warn: Project is vulnerable to: GHSA-9crc-q9x8-hgqq
Reason
Found 5/26 approved changesets -- score normalized to 1
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/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/quality.yml:30: 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:43: 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:56: 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:69: 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:17: 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 8 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 9 are checked with a SAST tool
Score
4.2
/10
Last Scanned on 2025-02-10
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/button
@chakra-ui/close-button
A React and Chakra UI close button component.
@chakra-ui/clickable
React hook and component that implements native button interactions
@chakra-ui/menu
A React component to render accessible menus
@chakra-ui/tag
This component displays as a tag with an optional link and/or button to remove the given tag.