> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daily.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Daily.createFrame()

> Creates a DailyCall instance with an embedded Daily Prebuilt iframe appended to the DOM.

`Daily.createFrame(parentEl, { properties })`

✓ Prebuilt✗ Custom

Creates a [`DailyCall`](https://docs.daily.co/reference/daily-js/daily-call-client) instance and embeds a Daily Prebuilt `iframe` in the DOM. Both arguments are optional. If `parentEl` is provided, the `iframe` is appended as a child of that element; otherwise it is appended to `document.body`.

## Parameters

**parentEl** `HTMLElement`

Optional. The DOM element to append the Daily Prebuilt `iframe` into. Defaults to `document.body` if omitted.

**properties** `DailyCallOptions`

Optional configuration. If `url` is not set here, it must be provided when calling [`join()`](https://docs.daily.co/reference/daily-js/instance-methods/join) or [`load()`](https://docs.daily.co/reference/daily-js/instance-methods/load). See [`DailyCallOptions`](https://docs.daily.co/reference/daily-js/types/daily-call-options) for the full list of options.

## Prebuilt-specific options

`createFrame()` supports three options that are specific to how it embeds and controls the Daily Prebuilt iframe.

### iframeStyle

A JavaScript CSS properties object applied directly to the `iframe` element. If omitted, the default styles depend on the parent: when appended to `document.body` the iframe floats as a window in the bottom-right corner; when appended to a specific `parentEl` it fills the width and height of that element.

```javascript theme={null}
// Make the call fullscreen
const call = Daily.createFrame({
  iframeStyle: {
    position: 'fixed',
    top: 0,
    left: 0,
    width: '100%',
    height: '100%',
  },
});
```

### layoutConfig

Customizes Grid View tile counts when Active Speaker View is disabled (via the `activeSpeakerMode` property or [`setActiveSpeakerMode()`](https://docs.daily.co/reference/daily-js/instance-methods/set-active-speaker-mode)). Specifies the minimum and maximum participant tiles per page when the browser is resized.

```javascript theme={null}
Daily.createFrame({
  layoutConfig: {
    grid: {
      minTilesPerPage: 3,  // default: 4, minimum: 1
      maxTilesPerPage: 36, // default: 24, maximum: 49
    },
  },
});
```

`maxTilesPerPage` is a ceiling, not an exact count: Prebuilt shows whichever is smaller, the number of tiles that fit or your maximum. It applies only to the desktop grid view. See [Layout configuration](https://docs.daily.co/docs/prebuilt/customizing-daily-prebuilt.md#layout-configuration).

### userData

Custom data associated with the local participant. In Daily Prebuilt, setting `userData.avatar` to a publicly accessible image URL displays that image on muted participant tiles and in the People tab. See [`setUserData()`](https://docs.daily.co/reference/daily-js/instance-methods/set-user-data) to update it after joining.

```javascript theme={null}
Daily.createFrame(parentEl, {
  userData: {
    avatar: 'https://example.com/avatar.jpg',
  },
});
```

![Video call with one participant using custom avatar image](https://mintcdn.com/daily-co/UZ5SeZfPxiPGRDvT/assets/prebuilt-custom-avatar.png?fit=max\&auto=format\&n=UZ5SeZfPxiPGRDvT\&q=85\&s=366d1363b8ad611cf167119ff0fee859)

## Return value

Returns a new [`DailyCall`](https://docs.daily.co/reference/daily-js/daily-call-client) instance.

## Example

```javascript theme={null}
const call = Daily.createFrame(document.getElementById('call-container'), {
  url: 'https://your-domain.daily.co/room-name',
});

await call.join();
```

## See also

> [card] Types
>
> * [DailyCallOptions](https://docs.daily.co/reference/daily-js/types/daily-call-options.md)

> [card] Methods
>
> * [Daily.createTransparentFrame()](https://docs.daily.co/reference/daily-js/factory-methods/create-transparent-frame.md)
> * [join()](https://docs.daily.co/reference/daily-js/instance-methods/join.md)
> * [leave()](https://docs.daily.co/reference/daily-js/instance-methods/leave.md)
> * [setActiveSpeakerMode()](https://docs.daily.co/reference/daily-js/instance-methods/set-active-speaker-mode.md)

> [card] Guides
>
> * [Call modes](https://docs.daily.co/docs/daily-js/concepts/call-modes.md)
> * [Call configuration](https://docs.daily.co/docs/daily-js/concepts/call-configuration.md)

> [card] Demos
>
> * [Daily Prebuilt demo](https://github.com/daily-demos/prebuilt-ui/)
> * [Fullscreen Daily Prebuilt demo](https://github.com/daily-demos/fullscreen-prebuilt-ui/)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.