# PymChild

A renderless helper that starts a Pym.js child on mount so an embed can resize its parent iframe; stores the instance in shared state.

**Category:** Components/Utilities/PymChild

**Import:** `import { PymChild } from '@reuters-graphics/graphics-components'`

## Props

| Prop | Type | Default | Required | Description |
|------|------|---------|:--------:|-------------|
| `polling` | `number` | `500` |  | Pym.js polling interval |

## Examples

### Demo

```svelte
<PymChild />
```

## Documentation

# PymChild

The `PymChild` component creates a [Pym.js](https://blog.apps.npr.org/pym.js/) child instance for embeddables.

```svelte
<script>
  import { PymChild } from '@reuters-graphics/graphics-components';
</script>

<PymChild polling={500} />
```

You can access the Pym.js child via `pym` in other components to send custom height updates to parent frames:

```svelte
<script>
  import { PymChild, pym } from '@reuters-graphics/graphics-components';

  const updateHeight = () => {
    if (pym.child) pym.child.sendHeight();
  };
</script>

<PymChild />

<button onclick={updateHeight}>Update height</button>
```
