Ory Elements Introduction
Ory Elements is a component library that allows you to build custom user interfaces for Ory self-service flows. It provides a set of pre-built components that can be easily integrated into your application, enabling you to create a seamless user experience while leveraging Ory's powerful authentication and identity management capabilities.
The following diagram illustrates how Ory Elements fits into the Ory ecosystem and your application architecture:
It is designed to work with Ory's self-service flows, such as login, registration, settings, verification, and recovery and the OAuth2 consent flow. It will automatically adjust to the configured identity schema and configuration of your Ory deployment, ensuring that your UI is always in sync with the backend. Ory Elements provides a consistent and user-friendly experience across all self-service flows, making it easier for users to interact with your application.
While it's default experience is a great starting point, Ory Elements allows you to customize the look and feel of your UI to match your brand and user experience requirements. You can use Ory Elements to build a custom UI that fits your application's design and user experience, while still leveraging Ory's powerful authentication and identity management capabilities.
Ory Elements Quickstart
Next.js (App Router)
Learn how to use Ory Elements in your Next.js application with the App Router.
Next.js (Pages Router)
Learn how to use Ory Elements in your Next.js application with the Pages Router.
Use Ory Elements with coding agents
The @ory/elements-react and @ory/nextjs packages ship an integration guide and a skill for coding agents in their agents and
skills directories. Because they are part of the package, they match the version you have installed. Agents don't look into
node_modules on their own, so paste these lines into your project's AGENTS.md, CLAUDE.md, or the file your agent reads:
- Ory Elements (`@ory/elements-react`, not the legacy `@ory/elements`): read `node_modules/@ory/elements-react/agents/GUIDE.md`
before changing authentication UI code.
- Ory for Next.js (`@ory/nextjs`, not `@ory/integrations`): read `node_modules/@ory/nextjs/agents/GUIDE.md` before changing
authentication code.
Versions that predate these files don't have the agents directory.
To replace parts of the UI, see the list of component slots described in Replacing components.