API reference
Everything inertia-ember exports, for an app whose server speaks Inertia. Each page has the signature, the options and standalone examples; the Guide explains the ideas behind them.
ts
import { createInertiaApp, Link, page, router, useForm } from 'inertia-ember';Components
| Export | Description |
|---|---|
Link | A link that makes an Inertia visit instead of a full page load. Non-GET links render a <button>. |
Head | Sets the document title and head tags, on the server too. |
Deferred | Shows a fallback until deferred props arrive. |
WhenVisible | Loads props when an element scrolls into view. |
WhenMounted | Renders its block only in the browser; server rendering shows the fallback. |
InfiniteScroll | Loads the next or previous page of a paginated prop as you scroll. |
Form | A form that sends its fields as an Inertia visit, reading them from the DOM by name. |
App | The root component createInertiaApp renders. You don't render it yourself. |
Forms and HTTP
| Export | Description |
|---|---|
useForm | A form with tracked fields, errors and state, sent as an Inertia visit. Optional Precognition. |
useHttp | The same fields, errors and state for plain JSON requests: the page stays put. |
createForm | Returns <Form> typed by its fields. |
useFormContext | The API of the <Form> around an element, for components inside it. |
InertiaForm | The class behind useForm's forms. |
InertiaHttp | The class behind useHttp's clients. |
Modifiers
| Export | Description |
|---|---|
bind | {{bind form 'field'}} connects an input, select or textarea to a form field. |
inertia | {{inertia}} turns any element into a link, with the same options as <Link>. |
Hooks
Reactive helpers for a page's data. Most take the component that owns them and clean up when it's destroyed.
| Export | Description |
|---|---|
usePoll | Reloads the page, or some props, on an interval. |
usePrefetch | Whether the current page came from the prefetch cache, and flush(). |
useProp | One prop with its loading state. |
useRemember | A tracked object that survives back and forward navigation. |
page | The current page: props, URL, flash data. Tracked and read-only. |
usePage | The current page, with its props typed. |
setLayoutProps | Hands props from a page up to its layouts. |
resetLayoutProps | Clears the props setLayoutProps set. |
Setup
| Export | Description |
|---|---|
createInertiaApp | Boots the app in the browser, or returns the page renderer for server rendering. |
createOwner | Builds an Ember owner from your services, for @service in pages. |
config | Inertia's global config: form and prefetch defaults, visitOptions. |
Router and core re-exports
@inertiajs/core's own objects, re-exported. The full reference is at inertiajs.com.
| Export | Description |
|---|---|
router | Visits, reloads, events, prefetching and client-side prop changes from code. |
progress | The progress bar: start, set and finish it yourself. |
http | The HTTP client behind every request: request, response and error handlers, or a client of your own. |
socketId | Sends this tab's websocket id with each request, so broadcasts can skip it. |
Types
| Export | Description |
|---|---|
PageSignature | A page component's signature: typed @props for Glint. |
LayoutSignature | A layout's signature: @props, @name and a block for the page. |
PagePropsOf | Your props plus the shared props and errors. |
SharedPageProps | The shared props, from your InertiaConfig. |
Page, PageProps, Method, UrlMethodPair, FormDataConvertible | Core types, re-exported from @inertiajs/core. |
LinkSignature, HeadSignature, DeferredSignature, WhenVisibleSignature, WhenMountedSignature, InfiniteScrollSignature, FormSignature, InertiaAppSignature, BindSignature, InertiaSignature | The Glint signature of each component and modifier. |
CreateInertiaAppOptions, AppOwner, PageRenderer, PageComponent, ResolvedPage, Modules | Setup types. |
Poll, Prefetch, Prop | What the hooks return. |
UseForm, FormSubmitOptions, UseHttp, HttpSubmitOptions, HttpOptimisticCallback, FormField, FormDataShape, OptimisticCallback, FormApi, LinkOptions | Form, HTTP and link types. |
Other entry points
| Import | Exports | Description |
|---|---|---|
inertia-ember/server | renderToString, createServer | Server-side rendering. See On the server. |
inertia-ember/vite | ember (default), framework | The Vite plugin for .gts files, and the page finder for @inertiajs/vite. See Installation. |
inertia-ember/echo | echo | A live-props transport over Laravel Echo (Reverb, Pusher, Ably). See Live props. |