Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
buhrmi authored Apr 4, 2024
1 parent 2d2f50d commit 0b8dc2a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ This is experimental and currently only supported in Svelte and React.

This fork introduces the `<Frame>` component. This component is used to encapsulate an Inertia page within another Inertia page. This is useful for creating modal dialogs, wizards, search sidebars, popovers, etc.

By default, hyperlinks and form submissions will load the response within the frame that contains the link or the form. To load the response in a different frame, add a `data-target` attribute. To load the response in the top (main) frame, use the `data=target="_top"` attribute.
By default, hyperlinks and form submissions will render the response within the frame that contains the link or the form. To change the frame in which an Inertia response is rendered, do one of the following:

You can overwrite the targeted frame in the server-side response by sending an 'X-Inertia-Frame' header.
- Add a `data-target="frame-id"` attribute to an `a` tag.
- Pass a `{target: frameId}` to `router.visit()` or `form.submit()`
- Specify the frame ID in an `X-Inertia-Frame` header from the server.

To target the top (main) frame, use `_top` as the frame ID.

Navigation within frames does not create new history entries. To enable this, a more substantial rewrite of the Inertia router would be required.

### Installation
### Try locally

Clone this repo, [build it](https://github.com/inertiajs/inertia/blob/master/.github/CONTRIBUTING.md#packages), and in your `package.json`, link it like this:

Expand Down

0 comments on commit 0b8dc2a

Please sign in to comment.