Skip to main content
Clever Ops

Quiet Cookie Banner

A consent bar without dark patterns, plain-language copy, a Decline button styled exactly equal to Accept, and a quiet policy links row, docked to the bottom edge.

Preview & code

Loading Quiet Cookie Banner preview

Installation

pnpm dlx shadcn@latest add @cleverui/banner-cookie-quiet

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { BannerCookieQuiet } from '@/components/blocks/banner-cookie-quiet'
Exampletsx
'use client'

import { useState } from 'react'
import { BannerCookieQuiet } from '@/components/blocks/banner-cookie-quiet'

export default function BannerCookieQuietDemo() {
  const [key, setKey] = useState(0)

  return (
    <div className="relative flex min-h-[320px] flex-col justify-end">
      <BannerCookieQuiet
        key={key}
        docked={false}
        message="We use a few cookies to understand what's useful on Ledger. Decline and we keep only what the site needs to work."
        links={[
          { label: 'Privacy policy', href: '#' },
          { label: 'Cookie settings', href: '#' },
        ]}
        onAccept={() => {
          window.setTimeout(() => setKey((k) => k + 1), 400)
        }}
        onDecline={() => {
          window.setTimeout(() => setKey((k) => k + 1), 400)
        }}
      />
    </div>
  )
}

API reference

BannerCookieQuiet accepts the following props.

PropTypeDefaultDescription
messagestringDEFAULT_MESSAGEplain-language consent line, no legalese
onAccept*() => voidfired when Accept is pressed; parent owns consent storage
onDecline*() => voidfired when Decline is pressed, first-class, symmetric with onAccept
acceptLabelstring'Accept'
declineLabelstring'Decline'
links{ label: string; href: string }[]quiet policy links, e.g. privacy policy and cookie settings
dockedbooleantruefixed to the viewport bottom when true; static in-flow band for previews/embeds when false

…plus everything from Omit< React.HTMLAttributes<HTMLElement>, 'onDrag' | 'onDragStart' | 'onDragEnd' | 'onAnimationStart' >: className, event handlers, aria attributes and the rest pass straight through.

Frequently asked questions

How do I install the Quiet Cookie Banner component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/banner-cookie-quiet`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Quiet Cookie Banner require?

Quiet Cookie Banner uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Quiet Cookie Banner to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services