Command Palette

Search for a command to run...

2.2kGitHub stars
Components

Carbon Ads

Display a Carbon Ads unit in Next.js apps, styled to match your shadcn/ui theme.

Features

  • Refreshes the ad on client-side navigation.
  • Matches your shadcn/ui theme in light and dark mode.
  • Keeps the slot height while loading and hides it when an ad blocker stops the script.

Installation

pnpm dlx shadcn@latest add @ncdai/carbon-ads

Usage

import { CarbonAds } from "@/components/carbon-ads"
<CarbonAds serve="XXXXXXXX" placement="yoursitecom" />

Take serve and placement from your ad tag in the Carbon dashboard (Zones > Get Ad Tags). Carbon serves one ad per page, so render a single CarbonAds per route.

API reference

CarbonAds

Prop

Type

References

Was this helpful?

Command Palette

Search for a command to run...