@netdata/netdata-ui
Version:
netdata UI kit
41 lines (34 loc) • 714 B
Markdown
A container that collapses the expands/collapses with animation.
```typescript
interface CollapsibleProps {
open?: boolean
duration?: number
children: () => ReactNode
[]: any
}
```
```JSX
export const SimpleMenu = props => {
const ref = useRef()
return (
<Flex {...props}>
<Flex ref={ref} background="disabled" padding={[4]}>
Target
</Flex>
{ref.current && (
<Drop
target={ref.current}
align={{ top: "bottom", left: "left" }}
>
<Flex background="border" padding={[6]}>
Drop Contents
</Flex>
</Drop>
)}
</Flex>
)
}
```