# Portal
A portal component for rendering content in an overlay, supporting fixed positions, anchored positioning, backdrop variants, and offset control.
```jsx featured
Open Portal
Portal Content
```
```css preview
.portal-backdrop[data-variant] {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 999;
&[data-variant="clear"] {
background-color: transparent;
}
}
.portal:not([data-anchored="true"]) {
position: fixed;
display: flex;
inset: 0;
width: 100dvw;
height: 100dvh;
z-index: 9999;
&[data-position="center"] {
justify-content: center;
align-items: center;
}
}
```
[View Source](https://github.com/LocusInc/locus-ui/tree/main/packages/locus-ui/src/components/portal)
## Anatomy
```jsx code no-header
```
## Examples
### Positions
The `position` prop on `Portal.Content` controls where the content appears on screen. Available positions are `tl`, `top`, `tr`, `left`, `center`, `right`, `bl`, `bottom`, and `br`.
```jsx
{["tl", "top", "tr", "left", "center", "right", "bl", "bottom", "br"].map(
(position) => (
{position.toUpperCase()}
{position.toUpperCase()}
),
)}
```
### Variants
The `Portal.Backdrop` component supports three variants: `clear`, `shadow`, and `blurred`.
```jsx
{["clear", "shadow", "blurred"].map((variant) => (
{variant.charAt(0).toUpperCase() + variant.slice(1)}
{variant.charAt(0).toUpperCase() + variant.slice(1)}
))}
```
### Anchor
When the `anchored` prop is set on `Portal.Content`, the content is positioned relative to the trigger element.
```jsx
Anchor
Anchor
```
### Anchor Positions
The `side` prop controls which side of the trigger the anchored content appears on: `top`, `right`, `bottom`, or `left`.
```jsx
{["top", "right", "bottom", "left"].map((side) => (
{side.charAt(0).toUpperCase() + side.slice(1)}
{side.charAt(0).toUpperCase() + side.slice(1)}
))}
```
### Anchor Aligns
The `align` prop controls the alignment of the anchored content relative to the trigger: `start`, `center`, or `end`.
```jsx
{["start", "center", "end"].map((align) => (
{align.charAt(0).toUpperCase() + align.slice(1)}
{align.charAt(0).toUpperCase() + align.slice(1)}
))}
```
### Offset
Use `sideOffset` and `alignOffset` to fine-tune the position of anchored content.
```jsx
Side Offset
Side Offset of 32px
Align Offset
Align Offset of 32px
```