Next.js integration
What @systhemaui/next adds over React, which components are Next twins, and best practices.
On this page
@systhemaui/next provides the Systhema components for Next.js. It re-exports framework-independent React components and supplies twins that use next/image, next/link or pathname-aware listeners. Import from this package in Next.js applications; a few twin props intentionally differ from React.
Design philosophyLink to this section
- When a component benefits from Next-specific behavior (such as
Image,Link,Button,Card,Chip,Header,Footer),@systhemaui/nextships a custom Next implementation. - When a component doesn't need Next-specific behavior (such as
Section,Paragraph,Heading,Form*,SearchField,Separator,Stack,Columns,Accordion),@systhemaui/nextre-exports it from@systhemaui/react.
Import components from @systhemaui/next in Next.js apps. Either you get the Next-aware version, or you get the React component verbatim.
import { Image, Link, Separator } from '@systhemaui/next'InstallationLink to this section
pnpm add @systhemaui/core @systhemaui/nextYou don't need to install @systhemaui/react separately. @systhemaui/next depends on it transitively. Install it explicitly when importing React-specific implementations directly.
Opt-in locale support bundles next-intl. See Frontend locales. Never install next-intl yourself; a second copy conflicts with the bundled one.
See Manual installation for the full setup including registry access and Tailwind wiring.
What this section coversLink to this section
This section covers only the Next-specific parts of @systhemaui/next: the provider, the gateway, the public origin helper and frontend locales. Props, subcomponents and examples of every component are on the component pages, each with a "Next.js" section where the Next twin differs.
Next.js twinsLink to this section
The package keeps hand-maintained twins where Next.js changes rendering or navigation. With the current source:
| Next.js behavior | Components |
|---|---|
| Optimized images | Image and Video, Avatar, QuoteAvatar. Video's poster uses the image path. |
Links through LinkHelper | Link, Button, Card, Chip, Icon, Header and Footer navigation. |
| Next media defaults | MediaWrapper and overlays compose the Next media components. |
| Images and links | PostCard and HighlightCard, PostsList. |
| Route-change handling | Header closes its mobile menu on pathname changes; AosListener, ParallaxListener and ScrollClassesListener restart on pathname changes. |
| Next listeners | SysthemaProvider mounts the Next-aware listeners. |
LinkHelper wraps next/link and also handles same-page hashes; see LinkHelper. Image behavior and sizing remain subject to the component's props; see Image.
Intentional API differencesLink to this section
The twin drift test compares exported names, workspace-declared props and literal vocabularies against React. Its ALLOWED list records these intentional differences:
- Next listeners take no
resetKeyprop and do not export the React listener props types. They restart throughusePathname(). - Next adds
CardLinkPropsandCard.link, an alias ofCard.a. Both link variants render throughnext/link. - Next exports
NextLinkChipPropsforChip.a. - Next
PostCardandHighlightCardrender their own images, so they omit React'srenderImageprop. They addlinked; setting it tofalsedisables their link wrapper.PostsListsupplies Next image and link defaults while honoring caller render overrides. - React exports the internal helpers
resolveSamePageHash,withTagProxy,DisableAnimationsContextanduseAnimationClassesfor twin implementations; the Next root does not re-export them.
Use the component pages for complete props. Next and React share the token-derived variant vocabulary, but their inherited image and link library props can differ.
Best practicesLink to this section
- Import components from
@systhemaui/nextin Next.js apps, including re-exported components. - Put SysthemaProvider in the root layout to mount the config server and Next listeners.
- Use
Card.linkfor a clickable card,Button.afor a button-style link andIcon.afor a linked icon. - Supply appropriate image dimensions and
sizes. Image disables optimization for GIF and SVG; useunoptimizedwhen another format needs to bypass the optimizer. - Import runtime values from
@systhemaui/core/clientin client-reachable code. The core root reaches token JSON that cannot be tree-shaken. See Client and server code. - Set
adminRouting: falsein the gateway for a Next-only application.
RelatedLink to this section
- Browser support (including how
withSysthema()drops Next's legacy polyfills) - Next.js template
- Payload template