Sha256: 07dbfecf6289e39d753f165d96ba106a39d9a6df2af4e145cba6072126fd2cc7

Contents?: true

Size: 329 Bytes

Versions: 396

Compression:

Stored size: 329 Bytes

Contents

import {useState} from 'react';


const useDropdown = (initial= true) => {
    
const [isDropDownClosed, setIsDropDownClosed] = useState(initial);

const toggleDropdown = () => setIsDropDownClosed((prev) => !prev);

return [
    isDropDownClosed,
    setIsDropDownClosed as any,
    toggleDropdown
]
}

export default useDropdown

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
playbook_ui-14.6.2.pre.alpha.PBNTR633dropdownavailablepropstable4305 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.7.0.pre.rc.6 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR576tooltiptruncatedformpills4304 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR633dropdownavailablepropstable4303 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.2.pre.alpha.PBNTR576tooltiptruncatedformpills4296 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1550lazysizesupgrade4295 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4274 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1607dependencydisplayymlupdate4271 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1538READMEroot4262 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1538READMEroot4260 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1550lazysizesupgrade4257 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1538READMEroot4254 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1538READMEroot4251 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.7.0.pre.rc.5 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.2.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4247 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.7.0.pre.rc.4 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.7.0.pre.rc.3 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.2 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.7.0.pre.rc.2 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx
playbook_ui-14.6.0.pre.alpha.dropdownclassfix4224 app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx