npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

chakra-cross-compatibility

v0.1.7

Published

A library to provide cross-version compatibility for Chakra UI components

Downloads

32

Readme

Chakra UI Cross Compatibility Layer

Provides a compatibility layer for Chakra UI components across V2 and V3 versions, allowing developers to use a consistent API regardless of the Chakra UI version.

Chakra V3 ➡️ Chakra V2 ✅ Chakra V2 ➡️ Chakra V3 ❌

The package translates Chakra v3 props/components to Chakra v2 props/components not the other way around.

Components will follow coding practices and API conventions of Chakra UI V3, while maintaining compatibility with V2.

⚠️ Warning

This package can run on Chakra v2, but does not officially support Chakra v3 syntax on Chakra v2. Rather, it is meant to be used in external libraries extending Chakra v3, then compiled to be used in Chakra v2. If the package is installed in a project using Chakra v2, it will not support all the prop typings during development, although it'll try its best to translate them (if you @ts-ignore the type errors).

Under the hood, the package does prop manipulations (for example, expanding onOpenChange to onOpen and onClose), but does not add these props to the typings as compiling from Chakra v2 to Chakra v3 IS NOT SUPPORTED.

Essentially, if the package is used in Chakra v2, it would look funky as V3 components would need to have V2 props attached to them. For example:

<Dialog.Root isOpen={isOpen} onClose={() => setIsOpen(false)} />

TLDR: Install into Chakra v2 at your own discretion.

Differences Between Official Chakra V3

Although we try to keep the API as close to Chakra V3 as possible, some things straight up don't make sense and work better in V2.

Tooltip

Open delay is default set to 0 (overridable) through props.

Limitations

The goal of this package is for things to "just work" without needing to change the code in your project. However, there are some limitations to be aware of.

ChakraProvider

The ChakraProvider is not supported in this package. Translating this component would require completely translating the Chakra UI theme system. Furthermore, if your project is in need of translating the ChakraProvider, it is probably time to upgrade your project to Chakra UI V3.

Toaster

In an attempt to keep the API consistent, the Toaster component is provided in this package. It will use the Chakra UI V3 API, but for V2 will internally use the V2 useToast hook. This means on V2, you will have to import toaster from this package instead of the Chakra UI V2 useToast hook to create toasts on both V2 and V3 with one codebase.

Menu

In V2, Menu.Trigger (MenuButton under the hood) will wrap the children in an additional <span> which would cause props like gap to not work, however, the translation layer merges:

'& > *': {
    display: 'inherit',
    flex: 'inherit',
    flexDirection: 'inherit',
    height: 'inherit',
    width: 'inherit',
    gap: 'inherit',
    padding: 'inherit',
    margin: 'inherit',
    justifyItems: 'inherit',
    justifyContent: 'inherit',
    alignContent: 'inherit',
    alignItems: 'inherit',
}

to the underlying MenuButton component's css styling in order to force the span to obey layout props provided.

Dialog/Modal

In Chakra V3, the way dialogs behave are similar to Menus in that their internal contexts store the open/close state of the component. However in Chakra v2, the Modal context only stores onClose and isOpen making it impossible to cleanly recreate similar behavior in v2. Therefore, I have forced the props open and onOpenChange for dialogs and removed the Dialog.Trigger component to provide compatibility with Chakra v2.

Portal-Based Components (ie. Menu)

Portals in Chakra v2 internally use the react-portals package which does not fit well with framer-motion. Do not try animating with portal based actions. If you need custom portal based animations, please use the ReactDOM.createPortal API.