--- title: Disclosure description: A simple, accessible foundation for building custom UIs that show and hide content, like togglable accordion panels. author: name: imskyleen url: https://github.com/imskyleen --- ## Installation ## Usage ```tsx Disclosure Button Disclosure Panel ``` ## Props
### Animate UI props #### DisclosurePanel ## Don't delete from the DOM The choice made is the same as Headless UI, i.e. to remove the element from the DOM for accessibility and performance reasons. However, this may pose a problem for SEO. If you want your Disclosure content to be taken into account by Google, please **replace the DisclosurePanel component with**: ```tsx title="components/animate-ui/headless-disclosure.tsx" const DisclosurePanel = React.forwardRef( ( { className, children, transition = { type: 'spring', stiffness: 150, damping: 17 }, as = React.Fragment, ...props }, ref, ) => { const { isOpen } = useDisclosure(); return ( {(bag) => ( {typeof children === 'function' ? children(bag) : children} )} ); }, ); ``` ## Credits - We use [Headless UI](https://headlessui.com/react/disclosure) for the disclosure component.