index.jsx 825 B

12345678910111213141516171819202122232425
  1. import React, { useRef } from 'react';
  2. import { Dropdown } from '@douyinfe/semi-ui';
  3. import { IconEdit } from '@douyinfe/semi-icons';
  4. import '@douyinfe/semi-foundation/dropdown/dropdown.scss';
  5. export default function Demo() {
  6. const ref = useRef();
  7. return (
  8. <div className={'demo-in-hover-elements'} ref={ref}>
  9. <span className={'content'}>ABCDEFG</span>
  10. <span className={'action'}>
  11. <Dropdown
  12. position={'bottomLeft'}
  13. getPopupContainer={() => ref.current}
  14. render={<article>I&apos;m Dropdown content.</article>}
  15. >
  16. {/* <Button>Hover Me</Button> */}
  17. <IconEdit size={'extra-large'} />
  18. </Dropdown>
  19. </span>
  20. </div>
  21. );
  22. }