react-feather#ArrowDown JavaScript Examples

The following examples show how to use react-feather#ArrowDown. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Landing.js    From popper.js.org with MIT License 5 votes vote down vote up
FlipExample = () => {
  const { reference, popper } = usePopper({ placement: 'bottom' });
  const scrollContainerRef = useRef();

  useLayoutEffect(() => {
    scrollContainerRef.current.scrollTop =
      window.innerWidth <= sizes.lg ? 490 : 450;
  }, []);

  const code = `
import { createPopper } from '@popperjs/core';

const popcorn = document.querySelector('#popcorn');
const tooltip = document.querySelector('#tooltip');

createPopper(popcorn, tooltip);
`;

  return (
    <ExampleBox>
      <ScrollContainer ref={scrollContainerRef}>
        <PopcornBox ref={reference} src={popcornBox} />
        <Tooltip ref={popper}>
          <TooltipName>Popcorn</TooltipName>
          <TooltipPrice>New Item</TooltipPrice>

          <Arrow data-popper-arrow />
        </Tooltip>
      </ScrollContainer>
      <ExampleText>
        <Heading>
          <ArrowUp />
          <ArrowDown /> Flipping
        </Heading>
        <p>
          <strong>Scroll the container</strong> (or the whole page) to see the
          tooltip flip to the opposite side once it's about to overflow the
          visible area. Once enough space is detected on its preferred side, it
          will flip back.
        </p>
        <Highlight code={code} />{' '}
        <span>
          <ExternalLinkStyled to="https://codesandbox.io/s/github/popperjs/website/tree/master/examples/flipping">
            Edit on CodeSandbox
          </ExternalLinkStyled>
        </span>
      </ExampleText>
    </ExampleBox>
  );
}