Package-level declarations

Types

Link copied to clipboard
sealed external interface DOMRouterOpts
Link copied to clipboard
sealed external interface FetcherFormProps : Props, SharedFormProps

Form props available to fetchers

Link copied to clipboard
Link copied to clipboard
sealed external interface FetcherSubmitFunction

Submits a fetcher <form> to the server without reloading the page.

Link copied to clipboard
sealed external interface FetcherSubmitOptions : SharedSubmitOptions

Submit options available to fetchers

Link copied to clipboard
sealed external interface FetcherWithComponents<TData> : Fetcher<TData>
Link copied to clipboard
sealed external interface FetcherWithComponentsLoadOpts
Link copied to clipboard

Form props available to navigations

Link copied to clipboard
sealed external interface GetFormSubmissionInfoResult
Link copied to clipboard
typealias JsonValue = Any?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed external interface NavLinkRenderProps
Link copied to clipboard
Link copied to clipboard
sealed external interface ScrollRestorationProps : Props
Link copied to clipboard
typealias SetURLSearchParams = (nextInit: (prev: URLSearchParams) -> URLSearchParamsInit?, navigateOpts: NavigateOptions?) -> Unit
Link copied to clipboard

Form props shared by navigations and fetchers

Link copied to clipboard
sealed external interface SharedSubmitOptions

Submit options shared by both navigations and fetchers

Link copied to clipboard
typealias SubmitFunction = (target: SubmitTarget, options: SubmitOptions?) -> Unit

Submits a HTML <form> to the server without reloading the page.

Link copied to clipboard
sealed external interface SubmitOptions : FetcherSubmitOptions

Submit options available to navigations

Link copied to clipboard
typealias SubmitTarget = Any?
Link copied to clipboard
Link copied to clipboard
sealed external interface UseBeforeUnloadOptions
Link copied to clipboard
sealed external interface UseFetcherOptions
Link copied to clipboard
sealed external interface UseFetchersResultItem : Fetcher<Any?>
Link copied to clipboard
sealed external interface UseFormActionOptions
Link copied to clipboard
sealed external interface UseLinkClickHandlerOptions
Link copied to clipboard
sealed external interface UsePromptOptions
Link copied to clipboard
sealed external interface UseScrollRestorationOptions
Link copied to clipboard
sealed external interface UseViewTransitionStateOpts
Link copied to clipboard
sealed external interface ViewTransition
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A @remix-run/router-aware <form>. It behaves like a normal form except that the interaction with the server is with fetch instead of new document requests, allowing components to add nicer UX to the page as the form is submitted and returns with data.

Link copied to clipboard

The public API for rendering a history-aware <a>.

Link copied to clipboard

A <Link> wrapper that knows if it's "active" or not.

Link copied to clipboard

Given a Remix Router instance, render the appropriate UI

Link copied to clipboard

This component will emulate the browser's scroll restoration on location changes.

Functions

Link copied to clipboard
external fun createBrowserRouter(routes: ReadonlyArray<RouteObject>, opts: DOMRouterOpts = definedExternally): Router
Link copied to clipboard
external fun createHashRouter(routes: ReadonlyArray<RouteObject>, opts: DOMRouterOpts = definedExternally): Router
Link copied to clipboard
external fun createSearchParams(init: URLSearchParamsInit = definedExternally): URLSearchParams

Creates a URLSearchParams object using the given initializer.

Link copied to clipboard
Link copied to clipboard
external fun getSearchParamsForLocation(locationSearch: String, defaultSearchParams: URLSearchParams?): URLSearchParams
Link copied to clipboard
external fun isButtonElement(value: Any?): Boolean
Link copied to clipboard
external fun isFormElement(value: Any?): Boolean
Link copied to clipboard
external fun isHtmlElement(value: Any?): Boolean
Link copied to clipboard
external fun isInputElement(value: Any?): Boolean
Link copied to clipboard
external fun shouldProcessLinkClick(event: LimitedMouseEvent, target: String = definedExternally): Boolean
Link copied to clipboard
external fun useBeforeUnload(callback: (event: BeforeUnloadEvent) -> Any?, options: UseBeforeUnloadOptions = definedExternally)

Setup a callback to be fired on the window's beforeunload event. This is useful for saving some data to window.localStorage just before the page refreshes.

Link copied to clipboard
external fun <TData> useFetcher(options: UseFetcherOptions = definedExternally): FetcherWithComponents<TData>

Interacts with route loaders and actions without causing a navigation. Great for any interaction that stays on the same page.

Link copied to clipboard

Provides all fetchers currently on the page. Useful for layouts and parent routes that need to provide pending/optimistic UI regarding the fetch.

Link copied to clipboard
external fun useFormAction(action: String = definedExternally, options: UseFormActionOptions = definedExternally): String
Link copied to clipboard
external fun <E : Element> useLinkClickHandler(to: To, options: UseLinkClickHandlerOptions = definedExternally): (event: MouseEvent<E, MouseEvent>) -> Unit

Handles the click behavior for router <Link> components. This is useful if you need to create custom <Link> components with the same click behavior we use in our exported <Link>.

Link copied to clipboard
external fun usePrompt(options: UsePromptOptions)

Wrapper around useBlocker to show a window.confirm prompt to users instead of building a custom UI with useBlocker.

Link copied to clipboard
external fun useScrollRestoration(options: UseScrollRestorationOptions = definedExternally)

When rendered inside a RouterProvider, will restore scroll positions on navigations

Link copied to clipboard
external fun useSearchParams(defaultInit: URLSearchParamsInit = definedExternally): JsTuple2<URLSearchParams, SetURLSearchParams>

A convenient wrapper for reading and writing search parameters via the URLSearchParams interface.

Link copied to clipboard
external fun useSubmit(): SubmitFunction

Returns a function that may be used to programmatically submit a form (or some arbitrary data) to the server.

Link copied to clipboard
external fun useViewTransitionState(to: To, opts: UseViewTransitionStateOpts = definedExternally): Boolean

Return a boolean indicating if there is an active view transition to the given href. You can use this value to render CSS classes or viewTransitionName styles onto your elements