Kits
Identity kit
Core brand config
Instead of hardcoding your product name or canonical URLs across headers, footers, and SEO scripts, we configure them in a single place. Install the brand helper:
npx shadcn@latest add @atroui/brandThis drops lib/brand.ts into your project, resolving environmental overrides or default fallbacks dynamically:
// lib/brand.ts
export function getBrand() {
return {
name: process.env.NEXT_PUBLIC_SITE_NAME || "My SaaS",
domain: process.env.NEXT_PUBLIC_SITE_DOMAIN || "mysaas.com",
email: process.env.NEXT_PUBLIC_SITE_EMAIL || "hello@mysaas.com",
siteUrl: process.env.NEXT_PUBLIC_SITE_URL || "https://www.mysaas.com",
tagline: "Own the UI, borrow the API.",
}
}To completely rebrand your site chrome, legal notices, and structured data, you only need to configure your environment variables:
NEXT_PUBLIC_SITE_NAME="AstroSaaS"
NEXT_PUBLIC_SITE_DOMAIN="astrosaas.com"
NEXT_PUBLIC_SITE_EMAIL="team@astrosaas.com"
NEXT_PUBLIC_SITE_URL="https://www.astrosaas.com"Schema.org structured data
For domain resolution in your own JSON-LD (or other structured data), install the registry helper — @atroui/seo drops lib/seo.ts with getSiteDomain() (reads getBrand().domain):
npx shadcn@latest add @atroui/seoimport { getSiteDomain } from "@/lib/seo"
const domain = getSiteDomain()Ready-made JSON-LD React components (SiteGraphJsonLd, ArticleJsonLd, etc.) are Host / headless helpers on the npm atroui package — not UI from the registry. Use them when you already depend on Host APIs; they are optional for a registry-only identity setup:
npm i atroui// app/layout.tsx — Host helper (optional)
import { SiteGraphJsonLd } from "atroui"
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<SiteGraphJsonLd />
{children}
</body>
</html>
)
}For technical docs or long-form developer articles, inject article metadata onto pages dynamically:
// app/blog/[slug]/page.tsx — Host helper (optional)
import { ArticleJsonLd } from "atroui"
export default function BlogPost({ post }) {
return (
<article>
<ArticleJsonLd
title={post.title}
description={post.description}
slug={post.slug}
date={post.date}
basePath="/blog"
/>
<h1>{post.title}</h1>
</article>
)
}Next.js metadata and canonical paths
Search engines penalize duplicate path strings. To prevent index pollution, ensure a stable metadataBase is set in the root layout metadata so relative paths resolve to the absolute canonical URL automatically.
// app/layout.tsx
import { Metadata } from "next"
import { getBrand } from "@/lib/brand"
const brand = getBrand()
export const metadata: Metadata = {
metadataBase: new URL(brand.siteUrl),
title: {
default: `${brand.name} - ${brand.tagline}`,
template: `%s · ${brand.name}`,
},
description: "High-performance dark-first component catalog.",
alternates: {
canonical: "/",
},
}Favicon and SERP checklist
Modern search results display your brand favicon right next to your snippet link. If you only provide a legacy favicon, Google may display a generic globe, lowering organic click-through rates.
To configure your favicons in a Next.js App Router project using AtroUI specifications, place these in your public/ directory:
/favicon-96.png— primary Google SERP candidate (square, ≥48)./favicon-48.png,/favicon-192.png— additional PNG sizes./favicon.ico— multi-resolution ICO including ≥48 frames (Google still probes this path)./icon.svg— crisp browser tabs./apple-touch-icon.png— 180x180 mobile app tile.
Then, reference them via relative URLs in your layout metadata (PNG before SVG):
// app/layout.tsx
export const metadata = {
// ...
icons: {
icon: [
{ url: "/favicon-96.png", sizes: "96x96", type: "image/png" },
{ url: "/favicon-48.png", sizes: "48x48", type: "image/png" },
{ url: "/favicon-192.png", sizes: "192x192", type: "image/png" },
{ url: "/icon.svg", type: "image/svg+xml" },
{ url: "/favicon.ico", sizes: "16x16 32x32 48x48 64x64 96x96 128x128 256x256" },
],
apple: [
{ url: "/apple-touch-icon.png", sizes: "180x180", type: "image/png" },
],
shortcut: ["/favicon-96.png"],
},
}Sitemap and robots
App Router supports automated dynamic sitemaps and search crawler instructions natively. Build your dynamic crawl tree using the dynamic sitemap helper:
// app/sitemap.ts
import type { MetadataRoute } from "next"
import { getBrand } from "@/lib/brand"
export default function sitemap(): MetadataRoute.Sitemap {
const brand = getBrand()
const lastModified = new Date()
return [
{
url: brand.siteUrl,
lastModified,
changeFrequency: "weekly",
priority: 1,
},
{
url: `${brand.siteUrl}/docs`,
lastModified,
changeFrequency: "monthly",
priority: 0.8,
},
]
}And drop crawler rules into app/robots.ts:
// app/robots.ts
import type { MetadataRoute } from "next"
import { getBrand } from "@/lib/brand"
export default function robots(): MetadataRoute.Robots {
const brand = getBrand()
return {
rules: {
userAgent: "*",
allow: "/",
},
sitemap: `${brand.siteUrl}/sitemap.xml`,
host: brand.siteUrl,
}
}Brand is not page content
AtroUI maintains a strict division of data to avoid typical template mistakes:
- Brand Profile — configured globally via environment variables (getBrand), powering headers, footers, JSON-LD, sitemaps, and default mail handles.
- Section Copy (CONTENT) — configured locally at the top of individual block files, representing the exact words displayed in marketing components (e.g. `DEFAULT_BRAND` on dynamic heroes).
This boundary ensures your product is immediately indexable on your production URL, with no generic template strings leaking into Google's index.