Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chakra-ui/system

Package Overview
Dependencies
Maintainers
3
Versions
639
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/system

Chakra UI system primitives

  • 0.0.0-dev-20230208114919
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
512K
decreased by-4%
Maintainers
3
Weekly downloads
 
Created

What is @chakra-ui/system?

@chakra-ui/system is a foundational package for building custom components in Chakra UI. It provides a set of utilities and hooks to create theme-aware, responsive, and accessible components with ease.

What are @chakra-ui/system's main functionalities?

Theming

The `useTheme` hook allows you to access the theme object, enabling you to create components that are consistent with your application's design system.

import { useTheme } from '@chakra-ui/system';

function ThemedComponent() {
  const theme = useTheme();
  return <div style={{ color: theme.colors.primary }}>Hello, Theme!</div>;
}

Responsive Styles

The `Box` component and responsive style props allow you to create components that adapt to different screen sizes easily.

import { Box } from '@chakra-ui/system';

function ResponsiveComponent() {
  return (
    <Box
      width={{ base: '100%', md: '50%' }}
      padding={{ base: '4', md: '8' }}
    >
      Responsive Box
    </Box>
  );
}

Style Props

Style props enable you to apply CSS styles directly to components using a prop-based syntax, making it easier to style components without writing separate CSS files.

import { Box } from '@chakra-ui/system';

function StyledComponent() {
  return <Box bg='tomato' w='100%' p={4} color='white'>Styled Box</Box>;
}

Custom Components

The `chakra` function allows you to create custom components with base styles and variants, making it easy to build reusable and consistent UI elements.

import { chakra } from '@chakra-ui/system';

const CustomButton = chakra('button', {
  baseStyle: {
    bg: 'blue.500',
    color: 'white',
    padding: '8px 16px',
    borderRadius: '4px',
  },
});

function App() {
  return <CustomButton>Click Me</CustomButton>;
}

Other packages similar to @chakra-ui/system

Keywords

FAQs

Package last updated on 08 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc