⚡️ Simple, Modular & Accessible UI Components for your React Applications

Overview

Chakra logo

Build Accessible React Apps with Speed ⚡️


Bundle Size Language grade: JavaScript MIT License NPM Downloads Github Stars Discord


Chakra UI provides a set of accessible, reusable, and composable React components that make it super easy to create websites and apps.

Looking for the documentation? 📝

For older versions, head over here => https://v0.chakra-ui.com

Latest version (v1) => https://chakra-ui.com

Features 🚀

  • Ease of Styling: Chakra UI contains a set of layout components like Box and Stack that make it easy to style your components by passing props. Learn more
  • Flexible & composable: Chakra UI components are built on top of a React UI Primitive for endless composability.
  • Accessible. Chakra UI components follow the WAI-ARIA guidelines specifications and have the right aria-* attributes.
  • Dark Mode 😍 : Most components in Chakra UI are dark mode compatible.

Support Chakra UI 💖

By donating $5 or more you can support the ongoing development of this project. We'll appreciate some support. Thank you to all our supporters! 🙏 [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

Testimonials

People throw React component libraries and design systems at me regularly. This might be the best one I've seen. The APIs are simple but composable and the accessibility on the couple components I looked is complete.

Great work @thesegunadebayo, really inspiring work. – Ryan Florence

Awesome new open-source component library from @thesegunadebayo. Really impressive stuff! – Colm Tuite

This is incredible work. Amazing job Segun! – Lee Robinson

Chakra UI is glorious! I love the consistent use of focus styling and the subtle animation – Guillermo ▲

Installing Chakra UI

To use Chakra UI components, all you need to do is install the @chakra-ui/react package and its peer dependencies:

$ yarn add @chakra-ui/react @emotion/react @emotion/styled framer-motion

# or

$ npm i @chakra-ui/react @emotion/react @emotion/styled framer-motion

Usage

To start using the components, please follow these steps:

  1. Wrap your application with the ChakraProvider provided by @chakra-ui/react.
import { ChakraProvider } from "@chakra-ui/react"

// Do this at the root of your application
function App({ children }) {
  return <ChakraProvider>{children}</ChakraProvider>
}

Optionally, you can wrap your application with the ColorModeProvider so you can toggle between light and dark mode within your app.

  1. Now you can start using components like so!:
import { Button } from "@chakra-ui/react"

function Example() {
  return <Button>I just consumed some ⚡️Chakra!</Button>
}

CodeSandbox Templates

create-react-app Templates

Check out our guide for information on how to use our official create-react-app templates.

Contributing

Feel like contributing? That's awesome! We have a contributing guide to help guide you.

Contributors

Thanks goes to these wonderful people


Segun Adebayo

💻 🚧 📖 💡 🎨

Tioluwani Kolawole

📖 💡 🚧

Devansh Jethmalani

💻

Adrian Aleixandre

💻 📖

Lee

📖

Kristóf Poduszló

💻 🤔 🐛 📖

Justin Hall

💻

Mark Chandler

💻 ⚠️ 📖 🚧

Folasade Agbaje

💻 🤔

Christian Nwamba

📖

Jonathan Bakebwa

📖 🤔

Alex Luong

💻 🔌

Jesco Wüster

💻

Dusty Doris

💻

Alex Lobera

💻

Tommaso De Rossi

💻

Odi

💻

Hendrik Niemann

💻

Matt Rothenberg

💻 💡

Luis Felipe Zaguini

💻

Jean

💻

Temitope Ajiboye

📖

Jonathan Kim

💻

Chris Thompson

💻

WALTER KIMARO

💻

Jack Leslie

💻

Ken-Lauren Daganio

💻

Ramon

💻

jess

📖 🔍

Ayelegun Kayode Michael

💻

Tal Williams

💻

Trevor Blades

💻 📖 🐛

Gord Lea

💻

Aggelos Arvanitakis

💻

Douglas Gabriel

💻

Martin Nordström

💻

Danny Tatom

💻

Simon Collins

💻

Santi Albo

💻 📖

PILO7980

💻

Ishimoto Koji

💻

Jeff Wen

💻

Pablo Saez

💻

Nejc Ravnik

💻

Julien Viala

💻

Sebastian Trebunak

💻 📖

Adam Plante

💻

Lúcio Rubens

💻

Jason Miazga

💻 📖

Gonzalo Pozzo

💻

Christian

💻 🚇

Christian Hagendorn

💻

Andrey Krasnov

💻

Dony Sukardi

💻

Meng

💻

Gabriele Belluardo

💻

Francois Best

💻

Tianci He

💻

Steven

💻

Baptiste Adrien

💻

Rob Bevan

💻

Tomasz

💻

徐愷

💻

David Wippel

💻

Naveen

💻

Vincent

💻

Osamah Aldoaiss

💻

Fred K. Schott

💻

Jared Palmer

💻

Austin Walela

💻

Tony Narlock

💻 📖

Thomas Maximini

💻

David Baumgold

💻

ralphilius

💻

Rahul Rangnekar

💻

Pierre Nel

💻

Pierre Grimaud

💻

Whisp R&D

💻

Makenna Smutz

💻 📖 🤔

Nelson Reitz

💻

Mohamed Nainar

📖

Mustafa Turhan

📖

Kim Røen

📖

Justin Mak

💻

Jeremy Davis

💻

Jeremy Lu

📖 💻

Ivan Dalmet

📖 💻 🔌

Dillon Curry

💻

idfunctor

💻

denkigai

💻

Aaron Adams

💻

Abdulazeez Adeshina

💻

Sandro

💻

Premkumar Shanmugam

💻

Tobias Meixner

💻

Jeremie Leblanc

💻

Kelvin Oghenerhoro

💻

David J. Felix

💻

Brody McKee

📖

Per Svensson

💻

Patrick Cason

📖

Ivo Ilić

💻

Avaneesh Tripathi

💻

balibebas

📖

Navin Moorthy

💻 📖

Tim Kindberg

📖

iodar

📖

MAO YUFENG

📖

Peng Jie

💻 📖

James Gee

💻 ⚠️ 💡

Anton

📖

Damnjan Lukovic

📖

Stanila Andrei

💻

Ekunola Ezekiel

💻

Ben Mitchinson

📖

Jess Telford

💻

Simo Aleksandrov

📖

Héricles Emanuel

💻

CodinCat

📖

Sam Dawson

🤔

hy2k

💻

Pierre Ortega

💻

Kerem Sevencan

📖

harveyhalwin

📖

Mansour benyoucef

📖

Andrew Garrison

📖

Carlos Rodrigues

📖

Dwight Watson

📖

ChasinHues

📖

Nahuel Greco

📆 🐛

Pablo Rocha

📖

Dustin Larimer

💻 🎨

Juliano Farias

📖

Joe Bell

🐛 💻

Henning Pohlmeyer

💻

Sivert Schou Olsen

📖

Andrei Lazarescu

📖

José Teixeira

🐛

Adriano Resende

📖

Victor Bastos

📖

Vincent

📖

Candice

🎨 🐛 📖

Dave Bauman

📖

TimKolberger

🐛 📖 💻

Stephane Mensah

🐛

iskanderbroere

📖

Dominik Sumer

💻

Pavel 'Strajk' Dolecek

📖

Keshav Bohra

📖

okezieuc

📖

Clayton Faria

📖

Andrew Ellis

💻 🐛 📖

Joel Gallant

🐛

Jaya Krishna Namburu

💻

Ifeoma Imoh

📖

Jason Adkison

🐛

Gauthier Rodaro

🐛

Tom Dohnal

💻

Sam Margalit

🐛

Marcus Wood

💻

Spencer Duball

📖

Jacob Arriola

📖

Kenley Jean

📖

Dennis Morello

🐛

Umar Gora

📖

Zyclotrop-j

💻

Hong Suk Woo

📖

Junho Yeo

📖

Thomas Siller

⚠️ 💻

Samuel Kauffmann

📖

Jozef Mikuláš

💻

João Victor

💻

yuichiro miyamae

📖

Gifa Eriyanto

🐛

Yuzi

⚠️ 💻

songheewon

📖

Prasanna Venkatesh T S

📖

anthowm

📖

Osama Ahmaro

🐛

Danan Wijaya

📖

electather

🐛

Shubham Kaushal

📖

Petter Sæther Moen

📖

Herman Nygaard

📖

jnmsl

📖

Mohamed Sayed

💻

Sam Poder

📖

Dominic Lee

📖 💻

Feras Aloudah

🤔

JP Ungaretti

📖

Endika Intxaurtieta

📖

Matt Wells

💻

Anant Jain

📖

Tom Chen

📖

Ernie Miranda

📖

(emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Testing supported by

BrowserStack

License

MIT © Segun Adebayo

Issues
  • V1 Feedback

    V1 Feedback

    Hi friends,

    Please leave all feedback related to the V1 beta release here.

    or you can join our discord channel: https://discord.gg/SC6QVZd

    Thank you.

    Topic: Feedback 💬 
    opened by segunadebayo 83
  • React Native support

    React Native support

    First of all I'm sorry if this is not the correct place to do this.

    So I'm seeing this UI library and it's astonishing. I didn't see such beauty in a while and I'm wondering if we could extend this exact lib to React Native.

    I know it's a huge step and I don't expect it to be fast, but in my point of view it would be amazing since I don't know many libraries that has this kind of support.

    What do you think? We can create a RFC or an umbrella issue/PR adding that possibility. I think it would be awesome to replicate the exact same styles to the mobile platform, since they are amazing.

    Thanks in advance!

    help wanted 🆘 
    opened by zaguiini 79
  • Migrate to TypeScript

    Migrate to TypeScript

    We're currently migrating the codebase to TypeScript to provide better type safety across all components.

    If you have any typescript related concerns, kindly comment below and find a walkaround for now till the TS version is released.

    Cheers.

    PS: Want to contribute to the migration, check out the dev-ts branch.

    Topic: TypeScript 🤠 stale 
    opened by segunadebayo 66
  • Add accessible Carousel component

    Add accessible Carousel component

    WAI-ARIA Authoring Practices has a section about building accessible carousel components:

    A carousel presents a set of items, referred to as slides, by sequentially displaying a subset of one or more slides. Typically, one slide is displayed at a time, and users can activate a next or previous slide control that hides the current slide and "rotates" the next or previous slide into view. In some implementations, rotation automatically starts when the page loads, and it may also automatically stop once all the slides have been displayed. While a slide may contain any type of content, image carousels where each slide contains nothing more than a single image are common.

    I think there is a great opportunity to build a composable component by following Reach UI's Philosophy. As I've observed, there are several layers of abstraction:

    • Carousel – Similar to Reach UI's Dialog, it would just wrap the 2 children below
      • CarouselControls – Contains Rotation Control, Next Slide Control, Previous Slide Control and Slide Picker Controls
      • CarouselRotator – Touch-controllable scroll container with a hidden scrollbar
        • CarouselSlide – Holds content to be presented

    I've already started building the foundation of some components above, mostly by following a CSS-Tricks article about Scroll Snap:

    CarouselRotator

    import { Flex, FlexProps } from '@chakra-ui/core';
    import React from 'react';
    import { MarginProps, ResponsiveValue } from 'styled-system';
    import CarouselSlide from './CarouselSlide';
    
    // TODO: https://www.w3.org/TR/wai-aria-practices-1.1/#grouped-carousel-elements
    
    function negateResponsiveValue<T>(value: ResponsiveValue<T>) {
      if (value == null) return value;
      if (typeof value === 'number') return -value;
      if (typeof value === 'string') return `-${value}`;
      if (Array.isArray(value)) return value.map(v => (v != null ? `${-v}` : v));
      return Object.fromEntries(
        Object.entries(value).map(([k, v]) => [k, v != null ? `${-v}` : v]),
      );
    }
    
    export interface CarouselProps extends FlexProps {
      children: React.ReactComponentElement<typeof CarouselSlide>[];
      slideIndex?: number;
      spacing?: MarginProps['margin'];
      spacingX?: MarginProps['mx'];
      spacingY?: MarginProps['my'];
    }
    
    export default function Carousel({
      children,
      slideIndex = 0,
      spacing,
      spacingX,
      spacingY,
      ...restProps
    }: CarouselProps) {
      return (
        <Flex
          as="section"
          aria-roledescription="carousel"
          aria-live="polite" // The carousel is NOT automatically rotating
          my={negateResponsiveValue(spacingY != null ? spacingY : spacing)}
          overflow="auto"
          css={{
            scrollSnapType: 'x mandatory',
            // TODO: Leave vendor prefixing to the underlying library
            '::-webkit-scrollbar': { width: 0 },
            '-msOverflowStyle': 'none',
            scrollbarWidth: 'none',
          }}
          {...restProps}
        >
          {React.Children.map(children, (child, i) =>
            React.cloneElement(child, {
              inert: i !== slideIndex ? '' : undefined,
              px: spacingX != null ? spacingX : spacing,
              py: spacingY != null ? spacingY : spacing,
            }),
          )}
        </Flex>
      );
    }
    

    There is still a lot of work to do, e.g. adding support for automatic rotating by setting aria-live to off.

    CarouselSlide

    import { Box, BoxProps } from '@chakra-ui/core';
    import React from 'react';
    
    // TODO: Follow the status of https://github.com/WICG/inert and remove polyfill
    import 'wicg-inert';
    
    export default function CarouselSlide({
      children,
      inert,
      ...restProps
    }: BoxProps) {
      return (
        <Box
          role="group"
          aria-roledescription="slide"
          flex="0 0 100%"
          css={{ scrollSnapAlign: 'center' }}
          {...restProps}
        >
          {/* TODO: Remove extra `div` once `shouldForwardProp` of `Box` supports `inert` */}
          <div inert={inert}>{children}</div>
        </Box>
      );
    }
    

    The inert attribute is required to disable tab navigation to undisplayed slides.

    declarations.d.ts

    Unfortunately, TypeScript and React don't support the inert attribute yet, thus, it cannot be specified as a boolean, but an empty string: ''.

    declare module 'react' {
      interface DOMAttributes<T> {
        inert?: '' | undefined;
      }
    }
    
    declare global {
      namespace JSX {
        interface IntrinsicAttributes {
          inert?: '' | undefined;
        }
      }
    }
    
    export {};
    
    Type: Feature 🚀 
    opened by kripod 54
  • Warning: Prop `id` did not match. Server:

    Warning: Prop `id` did not match. Server: "popover-trigger-33" Client: "popover-trigger-6"

    Hi,

    After upgrade to @[email protected], my application working on Next.js throw a warning error.

    Maybe has some breaking changes, the internal auto-id hook instead of @reach-ui/auto-id.

    image

    Type: Bug 🐛 
    opened by nghiepit 51
  • Warning: Prop `id` did not match. Server:

    Warning: Prop `id` did not match. Server: "accordion-button-3" Client: "accordion-button-6"

    Description

    Whenever I use an accordion with NextJs, I get mismatches for ids.

    Link to Reproduction

    https://codesandbox.io/s/snowy-thunder-gxsfl?file=/pages/index.tsx:0-1603

    Steps to reproduce

    First thing first, I can't reproduce it with the codesandbox. I think it's running next start while you only see the errors with next dev...

    I still linked a codesandbox with something that will reproduce the problem when ran in local.

    To reproduce, I simply create a new page, let's say "accordion.tsx" with this code taken directly from the documentation:

    import {
      Accordion,
      AccordionButton,
      AccordionIcon,
      AccordionItem,
      AccordionPanel,
      Box,
      Heading
    } from "@chakra-ui/react";
    import React from "react";
    
    export default function IndexPage() {
      return (
        <article>
          <Heading>Welcome to Chakra UI example</Heading>
          <Accordion allowToggle>
            <AccordionItem>
              <h2>
                <AccordionButton as="button" id="ttr">
                  <Box flex="1" textAlign="left">
                    Section 1 title
                  </Box>
                  <AccordionIcon />
                </AccordionButton>
              </h2>
              <AccordionPanel pb={4}>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
                eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
                ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
                aliquip ex ea commodo consequat.
              </AccordionPanel>
            </AccordionItem>
    
            <AccordionItem>
              <h2>
                <AccordionButton>
                  <Box flex="1" textAlign="left">
                    Section 2 title
                  </Box>
                  <AccordionIcon />
                </AccordionButton>
              </h2>
              <AccordionPanel pb={4}>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
                eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
                ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
                aliquip ex ea commodo consequat.
              </AccordionPanel>
            </AccordionItem>
          </Accordion>
        </article>
      );
    }
    

    Load the page, look at the console and I get:

    Warning: Prop `id` did not match. Server: "accordion-button-3" Client: "accordion-button-6"
    

    This is new from Chakra 1.6.4.

    Everything was working fine in my project with 1.6.3.

    When I migrated to 1.6.4, I saw there had been a big modification for generating ids so they could better match between server and client. (supposedly, I never had the problem before so I have no idea why it was "fixed")

    I looked at the modified file and it was a huge change. I tried it as is, but I couldn't make it work at all in my project because with 1.6.4 pretty much all ids were a mismatch now...

    Since I was using Chakra's useId hook for my own custom components, I created a new useId with the old code and removed the import from Chakra. Everything went back to normal.

    I didn't use any accordion at the time, so I never saw any other problem. But obviously, anything that would use Chakra 1.6.4 useId will behave incorrectly with NextJs, as we can see with Accordion.

    I figured someone would eventually create an issue because the console is completely red when used with NextJs in SSG... Turns out I'm the first to report it after all :(

    Chakra UI Version

    1.6.4

    Browser

    MS Edge 91.0.864.64 (latest at the moment)

    Operating System

    • [ ] macOS
    • [X] Windows
    • [ ] Linux

    Additional Information

    I tried passing my own id to the accordion button, but it's simply ignored by Chakra implementation, it overrides it with it's own automatic id. This should be looked at, if I could somehow pass my own id, I could easily patch in the old version to generate ids, the one that worked 100% with NextJs.

    Screenshot of a simple page with only the accordion on it image

    Screenshot of the console for that same page image

    Screenshot of React Dev Tools on the Accordion Button (id = "ttr") image

    Screenshot of React Dev Tools on the Accordion Button sub component "button" (id = "accordion-button-6") image

    I have no idea why on the server the id is accordion-button-3 while on the client it's accordion-button-6.

    My repository is private, but I could invite someone from the staff to debug it if necessary.

    If you require anything else, don't hesitate to ask.

    Regards,

    TheThirdRace

    Type: Bug 🐛 Topic: Testing 🧪 Topic: SSR 💻 Topic: Next.js ▲ 
    opened by TheThirdRace 45
  • Do we need a Multiselect component?

    Do we need a Multiselect component?

    A Multiselect is a common input, and it seems like Chakra is missing it.

    The API would use a compound component API. Example:

    <Multiselect
      selectedValues={[1, 2]}
      onSelectedValuesChange={newValues => /* ... */}/>
      <Option optionValue={1}>One</Option>
      <Option optionValue={2}>Two</Option>
      <Option optionValue={3}>Three</Option>
    </Multiselect>
    

    The API could be simpler and use strict props, but it would be less flexible. The compound component pattern would allow people to switch out the <Option /> component.

    I would like to contribute to Chakra by writing this component, does this sound like a good addition?

    Type: Feature 🚀 Type: API discussion 💡 not stale 
    opened by Samic8 43
  • Any plans to include table component ?

    Any plans to include table component ?

    if any, Is it going to be implemented from scratch or wrapper around something like react-table react-table

    Type: Feature 🚀 
    opened by ngprnk 35
  • Pass styleConfig part styles to custom ClassName props

    Pass styleConfig part styles to custom ClassName props

    Feature request

    Is your feature request related to a problem? Please describe.

    I am trying to style a component from an external library using Chakra multipart component theming, the component has multiple className props for each of it's part I want to pass the part styles from the styleConfig to the part className.

    Describe the solution you'd like

    I want to be able to do something similar to this

    export const CustomComponent= () => {
        const styles = useStyleConfig('CustomComponent', {});
        return (
            <ExternalComponent 
              className={styles.container}
              wrapperClassName={styles.wrapper}
              // or 
              otherClassName={sx(styles.other)}  />
        );
    };
    

    Is this already possible? if so maybe we could add this to the docs.

    If it's not, what is the recommended alternative?

    Describe alternatives you've considered

    I can just write CSS classNames but I wanted to use the design tokens from the theme

    opened by hazem3500 35
  • Having @emotion/styled in my deps breaks all styling

    Having @emotion/styled in my deps breaks all styling

    Bug report

    Describe the bug

    If I have @emotion/styled in my dependencies - even if I don't import it, I chakra-ui components have no stylings. Precisely, every styled-system props is kept as-is and ends-up in the css - and is obviously invalid.

    To reproduce

    start a project with the latest chakra-ui (tested with rc 5, 6 and 8) and latest @emotion-styled (10.0.27). Tested with CRA 4 and latest 3.x

    Expected behavior

    I should be able to use @emotion/styled in my project alongside chakra-ui

    Screenshots

    see https://github.com/chakra-ui/chakra-ui/discussions/2409

    System information

    • OS: ubuntu
    • Browser (if applies):Chrome
    • Version of @chakra-ui/core: rc 5, 6 and 8
    • Version of Node.js: 12 something

    Additional context

    opened by olup 33
  • chore(deps): bump shelljs from 0.8.4 to 0.8.5

    chore(deps): bump shelljs from 0.8.4 to 0.8.5

    Bumps shelljs from 0.8.4 to 0.8.5.

    Release notes

    Sourced from shelljs's releases.

    v0.8.5

    This was a small security fix for #1058.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    Type: Dependency 🔗 
    opened by dependabot[bot] 3
  • [Chakra Storybook Addon] Color mode switch breaks visual testing tools

    [Chakra Storybook Addon] Color mode switch breaks visual testing tools

    Description

    When using visual testing tools that take screenshots of stories, the color mode switch appears in all of them, triggering a false positives.

    Link to Reproduction

    N/A

    Steps to reproduce

    No response

    Chakra UI Version

    @chakra-ui/[email protected]

    Browser

    No response

    Operating System

    • [ ] macOS
    • [ ] Windows
    • [ ] Linux

    Additional Information

    Some example: image

    Ideally, the color mode selector should at the toolbar, or at least would be great to have the option to disable the color mode switcher.

    Type: Bug 🐛 Topic: Storybook Addon 
    opened by guilleironhack 0
  • refactoring(theme): Simplify exports

    refactoring(theme): Simplify exports

    Remove more than half the code by using more modern syntax.

    📝 Description

    Came across a unnecessarily bloated way of re-exporting default exports. This change simplifies it a bit.

    💣 Is this a breaking change (Yes/No):

    Nope.

    📝 Additional Information

    Totally understand if this is a stylistic choice, so if you don't want it, just close my PR, no feelings will be hurt.

    opened by selbekk 5
  • Variants on Text cause issue with ESLint and cannot build project

    Variants on Text cause issue with ESLint and cannot build project

    Description

    When creating a custom theme for the Text component, I except to be able to have variants but I have ESLint error informing me that this is not possible

    Link to Reproduction

    https://codesandbox.io/s/nervous-alex-uow1k

    Steps to reproduce

    1. Go to provided codesandbox demo
    2. Once the project is started go on index.tsx component
    3. The variant is correctly applied to the Text

    Chakra UI Version

    1.7.4

    Browser

    Brave 97

    Operating System

    • [X] macOS
    • [ ] Windows
    • [ ] Linux

    Additional Information

    Variants on the Text components causing an error when trying to build the project or deploying it on Vercel. The variants are correctly displayed on the screens (as showed in the codesandbox) but it's not possible to build the project (using next build).

    The error is the following: `Type error: Type 'string' is not assignable to type 'undefined'.``

    It's possible to fix the issue by using textStyles instead but this is not consistent with other components that all use variants (even the Heading component support variants).

    Type: Bug 🐛 workaround available ✌️ 
    opened by flavienbonvin 13
  • Version Packages

    Version Packages

    This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

    Releases

    @chakra-ui/[email protected]

    Minor Changes

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    • #5241 ebf1d98be Thanks @timonweber! - Allow style function types to be part of StyleConfig and MultiStyleConfig types to reflect the possible usage of style functions instead of style objects.

    @chakra-ui/[email protected]

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    • #5372 472612e7a Thanks @selbekk! - Update README to reflect the change of the default --out path to node_modules/@chakra-ui/styled-system/dist/declarations/src/theming.types.d.ts

    @chakra-ui/[email protected]

    Patch Changes

    [email protected]

    Patch Changes

    [email protected]

    Patch Changes

    [email protected]

    Patch Changes

    [email protected]

    Patch Changes

    @chakra-ui/[email protected]

    Patch Changes

    opened by github-actions[bot] 2
  • feat: add CSSVars component

    feat: add CSSVars component

    📝 Description

    Extract the hoisting of CSS variable to its own component to allow rehoisting.

    ⛳️ Current behavior (updates)

    Inline Code

    🚀 New behavior

    Render <CSSVars cssVarsRoot=".my-css-selector" /> to attach CSS variables.

    💣 Is this a breaking change (Yes/No):

    No

    opened by TimKolberger 4
  • docs: update .changelogrc

    docs: update .changelogrc

    opened by github-actions[bot] 3
  • Optimizing Grid virtualized DOMs

    Optimizing Grid virtualized DOMs

    Description

    When I load a lot of image elements in SimpleGrid or Grid, scrolling will be flash screen (probably too much DOMs), is there any plan to support virtualized DOMs?

    Problem Statement/Justification

    When I load a lot of image elements in SimpleGrid or Grid, scrolling will be flash screen (probably too much DOMs), is there any plan to support virtualized DOMs?

    Proposed Solution or API

    Support virtual DOMs parameters for components?

    Alternatives

    No response

    Additional Information

    No response

    needs triage 
    opened by TimonPeng 2
  • fix(descendant): enable property access via index

    fix(descendant): enable property access via index

    Closes #5317

    📝 Description

    Enable property access via index

    ⛳️ Current behavior (updates)

    Strict type checking with "noPropertyAccessFromIndexSignature": true enables accessing a field via the “dot” (obj.key) syntax, and “indexed” (obj["key"]) .Property is accessed via the "dot"(obj.key) syntax

    🚀 New behavior

    Since the Property 'index' comes from an index signature, it is now accessed with ['index']

    💣 Is this a breaking change (Yes/No):

    No

    📝 Additional Information

    opened by antwigambrah 4
  • Entering `e` in a `number-input` clamps to min value

    Entering `e` in a `number-input` clamps to min value

    Description

    When I enter the character e in a number-input field and deselect it, the value is clamped to the minimum numeric value.

    Link to Reproduction

    https://chakra-ui.com/docs/form/number-input#usage

    Steps to reproduce

    1. Go to https://chakra-ui.com/docs/form/number-input#usage
    2. Enter e in the text field
    3. Deselect text field
    4. See the value in the text field

    Chakra UI Version

    1.7.3

    Browser

    Firefox 96

    Operating System

    • [X] macOS
    • [ ] Windows
    • [ ] Linux

    Additional Information

    The floating point regex used to validate input checks each character one at a time, so it allows an e without it being used in scientific notation.

    Type: API discussion 💡 waiting for upvote 👍 
    opened by aeons 4
Releases(@chakra-ui/[email protected])
Owner
Chakra UI
UI components that make it super-easy to create websites and web apps with speed ⚡️
Chakra UI
Material-UI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.

Material-UI Quickly build beautiful React apps. Material-UI is a simple and customizable component library to build faster, beautiful, and more access

Material-UI 74.6k Jan 21, 2022
Collection of headless components/hooks that are accessible, composable, customizable from low level to build your own UI & Design System

Collection of headless components/hooks that are accessible, composable, customizable from low level to build your own UI & Design System powered by Reakit System.

Timeless 154 Jan 8, 2022
Fluent UI web represents a collection of utilities, React components, and web components for building web applications.

Fluent UI Web Fluent UI web represents a collection of utilities, React components, and web components for building web applications. This repo is hom

Microsoft 12.7k Jan 14, 2022
A set of completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.

Headless UI A set of completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS. Documentation For full

Tailwind Labs 12.7k Jan 17, 2022
Toolkit for building accessible rich web apps with React

Reakit Toolkit for building accessible rich web apps with React. Explore website » Sponsors By donating $100 or more you become a sponsor and help in

Reakit 5.4k Jan 16, 2022
Rheostat is a www, mobile, and accessible slider component built with React

Rheostat A mobile, tablet, desktop, and accessible slider for the web. Install npm install rheostat Initialize As of v3.0.0, the rheostat project reli

Airbnb 1.6k Jan 18, 2022
An accessible accordion built using React.

An accessible accordion built using React.

Peter Aiello 8 Nov 24, 2021
A reusable React implementation of accessible footnotes.

react-a11y-footnotes react-a11y-dialog is a thin React component to ease the use of accessible footnotes in React applications. This implementation is

Kitty Giraudel 19 Jan 10, 2022
A React component that renders a Likert scale. It is responsive and accessible.

React Likert Scale A React component that makes a Likert Scale for collecting data or to make a survey. It has the following features: it is fully res

Craig Creeger 3 Sep 24, 2021
An open-source UI component library for building high-quality, accessible design systems and web apps

An open-source UI component library for building high-quality, accessible design systems and web apps

Radix 2.8k Jan 14, 2022
A frontend Framework for building B2B applications running in the browser on top of REST/GraphQL APIs, using ES6, React and Material Design

react-admin A frontend Framework for building data-driven applications running in the browser on top of REST/GraphQL APIs, using ES6, React and Materi

marmelab 18.7k Jan 14, 2022
A React Component library for buliding modern applications easily & quickly.

A React Component library for building modern applications easily & quickly

Elementz 340 Jan 18, 2022
Simple React Bootstrap 4 components

reactstrap Stateless React Components for Bootstrap 4. Getting Started Follow the create-react-app instructions to get started and then follow the rea

reactstrap 10.2k Jan 13, 2022
dataminr-react-components - Collection of reusable React Components and utility functions.

react-components A collection of reusable React components with their own Flux lifecycle. What's inside react-components? Table Component From a simpl

Dataminr 263 Dec 17, 2021
ClearX is an alternative way to Redux and MobX to maintain the application state and provides a simple interface to bind it to UI components

ClearX is an alternative way to Redux and MobX to maintain the application state and provides a simple interface to bind it to UI components. It has utilities to set or get deep properties of nested data using paths.

Autodesk 18 Nov 10, 2021
🧩 Medly components provides numerous themable react components, each with multiple varitaions of sizes, colors, position etc.

?? Medly components provides numerous themable react components, each with multiple varitaions of sizes, colors, position etc.

Medly 63 Jan 10, 2022
Nextjs-components - A collection of React components

nextjs-components A collection of React components, transcribed from https://vercel.com/design. 1 Motivation TBD Todo's Unit test coverage Unit tests

null 22 Jan 15, 2022
React tooltip is a React.JS Component that brings usefull UX and UI information in selected elements of your website.

React Tooltip ✅ React tooltip is a React.JS Component that brings usefull UX and UI information in elements of your website. Installation ⌨️ React Too

Marc Ramos 1 Dec 22, 2021
Awesome chat widget for your React App

Awesome chat widget for your React App

Wolox 1.1k Jan 11, 2022