# Top Banner URL: /docs/components/banner The Top Banner component displays a banner at the top of the page. *** title: Top Banner description: The Top Banner component displays a banner at the top of the page. ------------------------------------------------------------------------------- You can change the variant of the banner to `default`, `minimal`, `popup`, `destructive`, `warning`, `success`, `info`, or `announcement`. ## Default Banner ```tsx title="src/components/banner-demo.tsx" import { Banner } from "@/components/billingsdk/banner"; export default function FreeTrialBannerDemo() { return (
{/* minimal hero example */}

Create next-generation digital products

Build faster with our platform

Get Started →
); } ```
## Installation ```bash npx shadcn@latest add @billingsdk/banner ``` ```bash pnpm dlx shadcn@latest add @billingsdk/banner ``` ```bash yarn dlx shadcn@latest add @billingsdk/banner ``` ```bash bunx shadcn@latest add @billingsdk/banner ``` ```bash npx @billingsdk/cli add banner ``` ```bash pnpm dlx @billingsdk/cli add banner ``` ```bash yarn dlx @billingsdk/cli add banner ``` ```bash bunx @billingsdk/cli add banner ``` ## Minimal Banner ```tsx title="src/components/banner-demo-two.tsx" import { Banner } from "@/components/billingsdk/banner"; export default function FreeTrialBannerDemo() { return (
{/* minimal hero example */}

Discover the best places to visit in the world

Explore the best places to visit in the world

Get Started →
); } ```
## Popup Banner ```tsx title="src/components/banner-demo-three.tsx" "use client"; import { Banner } from "@/components/billingsdk/banner"; import { useState } from "react"; import { Button } from "./ui/button"; export default function FreeTrialBannerDemoThree() { const [showBanner, setShowBanner] = useState(false); return (
{showBanner && ( )}
); } ```
## Gradient Banner The banner component supports animated gradient backgrounds with custom colors. The gradient automatically adapts to both light and dark themes. ```tsx title="src/components/banner-gradient-demo.tsx" "use client"; import { Banner } from "@/components/billingsdk/banner"; import { useState } from "react"; import { Button } from "./ui/button"; export const gradientColors = [ "rgba(0,149,255,0.56)", "rgba(231,77,255,0.77)", "rgba(255,0,0,0.73)", "rgba(131,255,166,0.66)", ]; export default function BannerGradientDemo() { const [showBanner, setShowBanner] = useState(false); return (
{/* Default Variant */}

Default Banner

{/* Minimal Variant */}

Minimal Banner

{/* Interactive Popup Demo */}

Popup Banner

{showBanner && ( )}
); } ```
## Destructive Banner ```tsx title="src/components/banner-destructive-demo.tsx" import { Banner } from "@/components/billingsdk/banner"; export default function FreeTrialBannerDemo() { return (
{/* minimal hero example */}

Create next-generation digital products

Build faster with our platform

Get Started →
); } ```
## Warning Banner ```tsx title="src/components/banner-warning-demo.tsx" import { Banner } from "@/components/billingsdk/banner"; export default function BannerWarningDemo() { return (
{/* minimal hero example */}

System Status Dashboard

Monitor system health and maintenance schedules

View Status →
); } ```
## Success Banner ```tsx title="src/components/banner-success-demo.tsx" import { Banner } from "@/components/billingsdk/banner"; export default function BannerSuccessDemo() { return (
{/* minimal hero example */}

Welcome to Premium

Enjoy unlimited access to all features

Explore Features →
); } ```
## Info Banner ```tsx title="src/components/banner-info-demo.tsx" import { Banner } from "@/components/billingsdk/banner"; export default function BannerInfoDemo() { return (
{/* minimal hero example */}

Developer Resources

Access documentation, guides, and API references

Browse Docs →
); } ```
## Announcement Banner ```tsx title="src/components/banner-announcement-demo.tsx" import { Banner } from "@/components/billingsdk/banner"; export default function BannerAnnouncementDemo() { return (
{/* minimal hero example */}

Advanced Analytics

Powerful insights to grow your business

Get Started →
); } ```
## Usage ```tsx import { Banner } from "@/components/billingsdk/banner"; ``` ```tsx // Default Banner } buttonLink="https://example.com/signup" variant="default" // default, minimal, popup /> ``` ```tsx // Minimal Banner ``` ```tsx // Popup Banner ``` ```tsx // Gradient Banner ``` ```tsx // Destructive Banner ``` ```tsx // Warning Banner ``` ```tsx // Success Banner ``` ```tsx // Info Banner ``` ```tsx // Announcement Banner ``` ## Props | Prop | Type | Required | Description | | ---------------- | ---------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------- | | `className` | `string` | ❌ | Additional CSS classes for styling | | `title` | `string` | ✅ | The title of the banner | | `description` | `string` | ❌ | The description of the banner | | `buttonText` | `string` | ❌ | The text of the button | | `buttonIcon` | `React.ReactNode` | ❌ | The icon of the button | | `buttonLink` | `string` | ❌ | The link of the button | | `variant` | `"default" \| "minimal" \| "popup" \| "destructive" \| "warning" \| "success" \| "info" \| "announcement"` | ✅ | The variant of the banner | | `autoDismiss` | `number` | ❌ | The time in milliseconds to auto dismiss the banner | | `onDismiss` | `() => void` | ❌ | The function to call when the banner is dismissed | | `gradientColors` | `string[]` | ❌ | Array of color strings for animated gradient background | ## Gradient Colors The `gradientColors` prop accepts an array of color strings (preferably in rgba format with alpha transparency). The gradient creates a smooth animated background effect. ### Color Guidelines: * Use rgba colors with alpha values between 0.5-0.8 for best results * Colors are automatically filtered for optimal contrast in both themes * The gradient animation uses a 70-degree angle for a diagonal effect ## Example ```tsx title="src/components/banner-demo.tsx" import { Banner } from "@/components/billingsdk/banner"; export default function FreeTrialBannerDemo() { return (
{/* minimal hero example */}

Create next-generation digital products

Build faster with our platform

Get Started →
); } ```