Skip to content
AXIcons
AXIcons
Theme

Next.js

Use AXIcons in the Next.js App Router, in Server and Client Components, with no configuration.

Install

Terminal
pnpm add @axcore/xicons-react

No next.config changes are needed: the package is standard ES modules.

Server Components

Icon components use no hooks and no browser APIs, so they render in Server Components without "use client". The SVG arrives in the HTML and adds no client JavaScript.

app/page.tsx
import { IconArrowRight } from "@axcore/xicons-react";
import Link from "next/link";

export default function Page() {
  return (
    <Link href="/docs" className="inline-flex items-center gap-1.5">
      Read the docs <IconArrowRight size={16} />
    </Link>
  );
}

Client Components

Inside a Client Component, icons work the same way. Only the icons that component imports join its client bundle.

app/like-button.tsx
"use client";import { useState } from "react";import { IconHeart, IconHeartFilled } from "@axcore/xicons-react";export function LikeButton() {  const [liked, setLiked] = useState(false);  const Icon = liked ? IconHeartFilled : IconHeart;  return (    <button aria-pressed={liked} aria-label="Like" onClick={() => setLiked(!liked)}>      <Icon className="size-5 text-rose-600" />    </button>  );}

Tested here

Something wrong or missing?Open an issue

Jump to
Browse all iconsIcon library
InstallationGetting started
Quick startGetting started
ReactIntegrations
React NativeIntegrations
↑↓ navigateopen⌘K toggle