import React, { useState } from 'react'
import { Button, Container, Typography, Popper } from '@toptal/picasso'
import { SPACING_4 } from '@toptal/picasso-utils'
const PopperContent = ({ children }: { children: React.ReactNode }) => (
{children}
)
const Example = () => {
const [absoluteAnchorEl, setAbsoluteAnchorEl] =
useState(null)
const [fixedAnchorEl, setFixedAnchorEl] = useState(
null
)
return (
Both boxes below have overflow: hidden and the Popper uses{' '}
disablePortal, so it renders in place as a real descendant
of the clipping box (a portaled Popper would already escape the clip
regardless of strategy). By default the Popper is positioned{' '}
absolute and clipped by the box's edge.{' '}
popperOptions={{ positionFixed: true }}{' '}
positions it relative to the viewport instead, escaping the clip.
default (absolute) — clipped