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

chakra-gui

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chakra-gui

So I was working on this Sidebar for [Choc UI](https://choc-ui.tech)😋, and I wanted to create a dropdown - that type you use for _Sub Menu Items_. I decided to do this with a Transition transition element, then i thought, this requires keeping a Transiti

  • 0.2.3
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source


🌺
chakra-gui



npm package npm  downloads NPM

GitHub Repo stars


Fused Chakra UI Components.




npm i chakra-gui





About

So I was working on this Sidebar for Choc UI😋, and I wanted to create a dropdown - that type you use for Sub Menu Items. I decided to do this with a Transition transition element, then i thought, this requires keeping a Transitiond state; best done with the useDisclosure Hook. But then I thought, if I'm going to have several dropdowns, this means several state objects. Why not create a component that manages them internally. But now, this is going to be reusable, so why not make it into a package, and here we are.

Long Story Short, this is a collection of Chakra Components that have been fussed to meet some specific needs.

Components

Transition

Helps control any Transition component's state internally.

Basic Usage The Transition Component accepts all props composed by the type Set defaultIsOpen prop to set initial state toin as true.

<!-- import { Collapse, VStack } from '@chakra-ui/react'; -->

<Transition type="{Collapse}" animateOpacity>
  <TransitionTrigger>Integrations</TransitionTrigger>
  <TransitionContent>
    <VStack>
      <span>Slack </span>
      <span>Jira</span>
      <span>Discord</span>
    </VStack>
  </TransitionContent>
</Transition>

With Internal State


<!-- import { Collapse, VStack } from '@chakra-ui/react'; -->

<Transition type={Collapse} animateOpacity>
  {({ isOpen, onToggle }) => (
    <>
      <TransitionTrigger onClick={onToggle}>Integrations</TransitionTrigger>
      <TransitionContent>
        <VStack>
          <span>Slack {isOpen ? "open" : "close"} </span>
          <span>Jira</span>
          <span>Discord</span>
        </VStack>
      </TransitionContent>
    </>
  )}
</Transition>

Hooks

useObjectMemo

Thanks to @dodas

Used to memoize object depending on its values. The object will be recreated only it some property value changes.

useObjectMemo({ a, b, c })
// equals to:
useMemo(() => ({ a, b, c }), [a, b, c])

FAQs

Package last updated on 07 Jun 2021

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