astro-ad-component
v1.0.4
Published
This React-based Ad Component is designed for use within an Astro project. It provides an easy way to display advertisements by embedding Google AdSense ads or custom ads with a simple, customizable interface.
Downloads
5
Readme
Astro Ad Component
This React-based Ad Component is designed for use within an Astro project. It provides an easy way to display advertisements by embedding Google AdSense ads or custom ads with a simple, customizable interface.
Features
- Client-Side Rendering: Ensures that ads are only rendered on the client side, preventing server-side rendering issues.
- Google AdSense Integration: Automatically initializes Google AdSense scripts if they are loaded on the page.
- Customizable Styles: Allows you to apply custom styles and classes for seamless integration with your site's design.
- Fallback Content: Displays fallback content when ads are not available or scripts fail to load.
Installation
To use this component in your Astro project, you need to ensure React is configured in your Astro project.
Step 1: Install Dependencies
If not already installed, add React to your Astro project:
npm install react react-dom