API Reference
The API reference documents every Remix module, function and type. Use it when you know what you want to look up. To learn how the pieces fit together, start with the guides.
Installation
Remix is available on npm:
npm i remixImports
Each feature in Remix is available in its own module:
import { createRouter } from 'remix/router'
import { route } from 'remix/routes'
import { css } from 'remix/component'The API Reference uses the same module names without the remix/ prefix. For example, router documents remix/router.
Remix UI is versioned separately and imported from @remix-run/ui/*.
Modules
Routing and requests
router: handle requests with routes, controllers and middleware on the Fetch APIroutes: define typed route maps for routers, links and formsroute-pattern: match and generate URLs with strong typingmiddleware: sessions, auth, CSRF, CORS, compression, static files, logging and moreresponse: helpers for HTML, file, redirect and compressed responsesheaders: typed classes for parsing and building HTTP headerscookie: type-safe cookie parsing and serialization, with signingfetch-proxy: forward requests to another servernode-fetch-server: run a Fetch API handler on Node's HTTP server
UI
component: components that render on the server and hydrate in the browserui: headless, accessible UI primitives and animation utilitiesspa: client-rendered application routingassets: compile browser JavaScript, TypeScript and CSS on demandhtml-template: HTML template literals with automatic escapingcomponent-hmr: hot module replacement for componentsmultiple-import-maps-polyfill: support import maps added after the page loads
Data and validation
data-schema: tiny, standards-aligned schema validationdata-table: typed relational queries and migrations for MySQL, PostgreSQL and SQLite
Sessions and auth
session: server-side session managementsession-storage: cookie, filesystem, memory, Memcache and Redis session storageauth: credential, OAuth and OIDC login flows
Files and uploads
form-data-parser: stream file uploads instead of buffering them in memorymultipart-parser: fast streaming multipart parsingfile-storage: key/value storage forFileobjects, on disk, in memory or in S3lazy-file: lazy, streamingBlobandFileobjectsfs: read local files as lazy, streamingFileobjectsmime: MIME type detection and content-type helperstar-parser: streaming tar archive parsing
Tooling and testing
cli: theremixcommand for creating apps, running migrations, listing routes and running teststest: a test framework for JavaScript and TypeScriptassert:node:assert-compatible assertions and anexpectAPI for any environmentnode-tsx: run Node.js with TypeScript and JSX supportnode-hmr: run Node.js apps with hot module reloadingterminal: ANSI styles and output helpers for command-line tools