--- title: Float description: Used to anchor an element to the edge of a container. links: source: components/float storybook: components-float--basic --- ## Usage Float requires a parent element with `position: relative` style applied. ```jsx import { Box, Float } from "@chakra-ui/react" ``` ```jsx
``` ## Examples ### Placement Use the `placement` prop to position the element along the edges of the container. ### Offset X Use the `offsetX` prop to offset the element along the x-axis. ### Offset Y Use the `offsetY` prop to offset the element along the y-axis. ### Offset Use the `offset` prop to offset the element along both axes. ### Avatar Here's an example of composing a `Float` component with an `Avatar` component. ## Props