# layout.anchor

A plain box with no look that positions what sits inside it: the anchor for a badge or a menu placed over an element

Component: [`<Layout>`](https://www.prongs.dev/docs/components/layout.md) · Renders: `<div>` · Profile: [UI](https://www.prongs.dev/docs/intents/ui.md) · Comes from: starter

## Example

```tsx
<Layout intent="layout.anchor">
  …
</Layout>
```

## Connections

- Built from: [`arrange.stack`](https://www.prongs.dev/docs/intents/ui.md#arrange-stack)

## Choosing between neighbours

| If it is for… | Use |
|---|---|
| A plain box with no look that positions what sits inside it: the anchor for a badge or a menu placed over an element | `layout.anchor` (this page) |
| A visible box with a background or border | [`layout.panel`](https://www.prongs.dev/docs/intents/layout/panel.md) |

## For registry authors

**Starter intents.** These are the intents `prongs add` puts in your registry, shown in this site’s theme. Yours are your own `registry.ts`: rename, restyle and add to them, and see them with `prongs add gallery`.

What this intent is built from and its entry in `components/prongs/registry.ts`. You only need this to change how it looks or to add an intent like it.

How layout.anchor resolves, and its definition

Each layer adds to the one before it; a later class wins over an earlier one that sets the same thing.

- [`arrange.stack`](https://www.prongs.dev/docs/intents/ui.md#arrange-stack) — Children in a column, free to shrink inside a row or grid

  ```
  flex min-w-0 flex-col
  ```

- `layout.anchor` (this page) — A plain box with no look that positions what sits inside it: the anchor for a badge or a menu placed over an element

  ```
  relative
  ```

Final classes

```
flex min-w-0 flex-col relative
```

Definition

```ts
'layout.anchor': {
  kind: 'semantic',
  description: 'A plain box with no look that positions what sits inside it: the anchor for a badge or a menu placed over an element',
  refs: ['arrange.stack'],
  binding: { classes: 'relative' },
  notFor: [
    {
      context: 'a visible box with a background or border',
      instead: 'layout.panel',
    },
  ],
},
```
