Socket
Book a DemoInstallSign in
Socket

@ctrl/react-adsense

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ctrl/react-adsense

Typescript adsense module

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
4.4K
38.78%
Maintainers
1
Weekly downloads
 
Created
Source

@ctrl/react-adsense npm

DEMO: https://react-adsense.xmplaylist.com

Install

npm install @ctrl/react-adsense

Use

Use the standard AdSense code somewhere in your <head></head> as you normally would

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
import React from 'react';
import {Adsense} from '@ctrl/react-adsense';

// ads with no set-up
<Adsense
  client="ca-pub-7640562161899788"
  slot="7259870550"
/>

// ads with custom format
<Adsense
  client="ca-pub-7640562161899788"
  slot="7259870550"
  style={{ width: 500, height: 300 }}
  format=""
/>

// responsive and native ads
<Adsense
  client="ca-pub-7640562161899788"
  slot="7259870550"
  style={{ display: 'block' }}
  layout="in-article"
  format="fluid"
/>

Keywords

ads

FAQs

Package last updated on 16 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts