🎨
UI Component1M+/wkMIT

@chakra-ui/react

Chakra UI is an accessible, modular React component library that provides a set of composable building blocks for creating user interfaces with speed. Chakra's

Installation

npm
npm install @chakra-ui/react @emotion/react @emotion/styled
yarn
yarn add @chakra-ui/react @emotion/react @emotion/styled
pnpm
pnpm add @chakra-ui/react @emotion/react @emotion/styled

Import

ESM
import { ChakraProvider, Button } from '@chakra-ui/react';

Quick Example

usage
import { Box, Button, Heading, Text, Stack } from '@chakra-ui/react';

function Card() {
  return (
    <Box bg="white" p={6} rounded="xl" shadow="md">
      <Heading size="md" mb={2}>Hello</Heading>
      <Text color="gray.600" mb={4}>Welcome to Chakra UI</Text>
      <Stack direction="row" spacing={3}>
        <Button colorScheme="blue">Primary</Button>
        <Button variant="outline">Secondary</Button>
      </Stack>
    </Box>
  );
}

About @chakra-ui/react

Chakra UI is an accessible, modular React component library that provides a set of composable building blocks for creating user interfaces with speed. Chakra's key differentiator is its style props system — components accept CSS properties directly as props (bg='blue.500', p={4}, fontSize='lg'), powered by a comprehensive theme token system that ensures design consistency. The theme system maps semantic tokens to values: colors use a numeric scale (blue.100 through blue.900), spacing uses a consistent scale, and responsive values are expressed as arrays [base, md, lg] or objects {{ base: 'sm', md: 'lg' }}. Chakra UI includes essential components like Box, Flex, Grid, Stack, Button, Input, Modal, Drawer, Toast, Menu, Tabs, Accordion, and form controls, all with built-in accessibility features including focus management, keyboard navigation, and ARIA attributes. The library supports dark mode through useColorMode with automatic class-based or system preference detection. Component variants are defined in the theme, enabling consistent styling across instances. Chakra's factory function (chakra.div) creates styled components that accept all style props. The library has been widely adopted for its excellent developer experience, particularly by teams that prefer a prop-based styling approach over CSS class names.

Quick Facts

Package@chakra-ui/react
CategoryUI Component
Weekly Downloads1M+
LicenseMIT
Installnpm install @chakra-ui/react @emotion/react @emotion/styled

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.