Frontend Blocks
typescript
Intermediate
Next.js Metadata API
Dynamic Open Graph metadata generation per page using the Next.js 14 Metadata API.
typescript
import type { Metadata } from "next";
export async function generateMetadata({ params }): Promise<Metadata> {
const mod = await fetchModule(params.slug);
return {
title: `${mod.title} | NexDevTeam`,
description: mod.description,
openGraph: {
title: mod.title,
description: mod.description,
type: "article",
},
twitter: { card: "summary_large_image" },
};
}
Prerequisites
- next.js >= 14
Pro Tips
- → Use generateStaticParams to pre-render at build time.
Commercial Licensing
Acquire a production access token or template license for enterprise deployment.
Module Info
- Language
- typescript
- Level
- Intermediate
- Read time
- 3 min
- Published
- Oct 2025
- License
- Commercial License
Newsletter
New modules every week, directly to your inbox.
Similar Modules
Copy to Clipboard Button
React component that copies text to clipboard and shows a Copied! confirmation.
typescript
·
Beginner
Framer Motion Fade-In Wrapper
Reusable component that fades any child element in on mount.
typescript
·
Beginner
Compound Component Pattern
Implement a flexible Tabs component using React Context and compound component pattern.
typescript
·
Intermediate