# <portal>

A live window onto another page: blurred and dimmed under a glass rim, it opens to full screen on a tap.

Category: Navigation.

```ham
<portal id="myapps"
        src="myapps.ham"
        label="My Apps"
        close="top-left"
        effect="ripple zoom"
        rim="12"
        style="w-full h-220 rounded-3xl blur-12 dim-20"/>
```

No picture: the live page it opens isn't drawn in a still yet.

## Attributes

| Name | What it does | Default |
|---|---|---|
| `close` | Draw the standard close button there when open (back and #id.close always work). (top-left, top-right) |  |
| `close-duration` | Closing time in ms (default ~0.65 of duration). |  |
| `close-ripple-amplitude` | Closing waves: displacement px (default: ripple-amplitude). |  |
| `close-ripple-gap` | Closing waves: ms apart (default: ripple-gap). |  |
| `close-ripple-life` | Closing waves: seconds on screen (default: ripple-life). |  |
| `close-ripple-speed` | Closing waves: px/s (default: ripple-speed). |  |
| `close-ripple-width` | Closing waves: wavelength px (default: ripple-width). |  |
| `close-ripples` | Waves when it closes (default: ripples). They start where the close came from: the close button, the swiped edge, else the window. |  |
| `closed-scale` | The page's scale inside the closed window, about its center (0.85: drawn smaller, so opening zooms in as it unblurs). It grows to 1 on the same curve as the unblur, carrying on from the press dip; closing shrinks it back. 1 = as is. | `1` |
| `duration` | Opening time in ms. | `1600` |
| `effect` | What plays as it opens and closes, any of: ripple (waves across the screen from the tap, set by ripples / ripple-*), zoom (the page swells and settles, effect-zoom), none. Several combine: effect="ripple zoom". Color filters (grayscale, brightness-N …) in its style fade out as it opens. | `ripple` |
| `effect-zoom` | With effect="zoom": how far the page swells mid-motion. | `1.15` |
| `label` | Accessible name of the closed portal (not drawn). | `Open` |
| `press-overshoot` | With press:scale-N in the style (the window sinks while pressed and opens from the dip): how far the spring out of the dip overshoots; 0 = none. | `1.7` |
| `rim` | Width in px of the glass rim along the inside of the window edge: the page under it magnified, as through the thick edge of a lens. 0 = no rim. It thins away as the portal opens. | `10` |
| `rim-blur` | The rim band's own blur in px (default: the window's blur-N). It fades with the rim as the portal opens. |  |
| `rim-color` | Highlight line on the rim's outer edge. | `#FFFFFF8C` |
| `rim-dim` | The rim band's own black veil in % (default: the window's dim-N). It fades with the rim as the portal opens. |  |
| `rim-inner-color` | Highlight line on the rim's inner edge. | `#FFFFFF47` |
| `rim-zoom` | How much the rim magnifies the page across the band, like the curved edge of a lens; it meets the center with no step. 1 = no magnification. | `1.35` |
| `ripple-amplitude` (also `ripple-size`) | How far each wave displaces the screen, px. | `60` |
| `ripple-gap` | Milliseconds between the waves. | `200` |
| `ripple-life` | Seconds each wave stays on screen. | `1.4` |
| `ripple-speed` | Wave speed in px/s. | `170` |
| `ripple-width` | Wavelength in px. | `180` |
| `ripples` | Waves across the whole screen from the tap point when it opens; 0 = none. No tap_effect needed. | `3` |
| `src` | The page to show: a fragment, like a navigate: page (a full <app> is refused). |  |

## Commands

| Name | What it does |
|---|---|
| `close` | Shrink back into the box, keeping the page as it is. |
| `open` | Expand to the screen and make it usable; \$id.open turns true. |
| `toggle` | Open or close. |

## Readings

| Name | What it does |
|---|---|
| `open` | Whether it fills the screen. |

Any tag also takes gestures: `@on.tap`, `@on.longpress`, `@on.doubletap` and `@on.swipeleft` (and right, up and down). `@click` runs on a tap too.

## Related tags

- [`<bottom-nav-item>`](https://hypeapps.dev/docs/reference/bottom-nav-item.md): One item of a bottom navigation bar: an icon and label that load a page or run a statement.
- [`<bottom-navigation-bar>`](https://hypeapps.dev/docs/reference/bottom-navigation-bar.md): The tab bar along the bottom of a screen; each item swaps a page into the main area.
- [`<nav-item>`](https://hypeapps.dev/docs/reference/nav-item.md): The older spelling of a bottom navigation item: metadata the bar reads, not drawn by itself.
- [`<navigation-rail>`](https://hypeapps.dev/docs/reference/navigation-rail.md): A vertical bar of destinations down the side of the screen, each with its own content panel.
- [`<rail-item>`](https://hypeapps.dev/docs/reference/rail-item.md): One destination in a navigation rail: an icon, a label and the content shown when it is picked.
- [`<tab>`](https://hypeapps.dev/docs/reference/tab.md): One pane of a tab bar: a label or icon in the bar, and content built the first time it is shown.
- [`<tab-bar>`](https://hypeapps.dev/docs/reference/tab-bar.md): A Material tab bar with swipeable panes; each <tab> child is a label and its content.

All tags: https://hypeapps.dev/docs/reference.md · The full reference: https://hypeapps.dev/llms.txt
