npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tickboxhq/banner-default

v1.0.0

Published

Drop-in styled consent banner and notice components for Tickbox

Readme

@tickboxhq/banner-default

A styled consent banner and notice card for Tickbox. Reach for this when you don't want to design and build your own.

If you do want your own, @tickboxhq/react and @tickboxhq/vue already export headless <ConsentBanner> and <ConsentNotice> render-prop components. This package just adds visuals on top.

Install

pnpm add @tickboxhq/banner-default

You'll also need the framework adapter (which you probably already have):

# React
pnpm add @tickboxhq/core @tickboxhq/react

# Vue / Nuxt
pnpm add @tickboxhq/core @tickboxhq/vue

React

import { ConsentProvider } from '@tickboxhq/react'
import { ConsentBannerDefault } from '@tickboxhq/banner-default/react'
import config from './consent.config'

export default function App() {
  return (
    <ConsentProvider config={config}>
      {/* your app */}
      <ConsentBannerDefault policyUrl={config.policy?.url} />
    </ConsentProvider>
  )
}

For sites with only notice-mode categories (UK DUAA-exempt analytics like Plausible or GoatCounter):

import { ConsentNoticeDefault } from '@tickboxhq/banner-default/react'

<ConsentNoticeDefault policyUrl="/privacy" />

Vue / Nuxt

<script setup lang="ts">
import { ConsentBannerDefault } from '@tickboxhq/banner-default/vue'
import config from './consent.config'
</script>

<template>
  <ConsentBannerDefault :policy-url="config.policy?.url" />
</template>

For notice-only sites:

<script setup lang="ts">
import { ConsentNoticeDefault } from '@tickboxhq/banner-default/vue'
</script>

<template>
  <ConsentNoticeDefault policy-url="/privacy" />
</template>

Props

Both components accept the same shape:

| Prop | Type | Default | Notes | |---|---|---|---| | policyUrl | string | — | Privacy policy URL. Hidden if omitted. | | theme | 'light' \| 'dark' | follows prefers-color-scheme | Force a theme. | | locale | string | 'en' | BCP-47 tag, or 'auto'. See "Languages" below. | | copy | Partial<BannerCopy> / Partial<NoticeCopy> | resolved from locale | Override individual labels. |

<ConsentNoticeDefault> also takes optOutCategoryId (default 'analytics') — the category to deny when the user clicks "Opt out".

Languages

Built-in: en, de, fr, es, it, nl, pt, pl, uk. Pass any BCP-47 tag — 'fr-CH' resolves to 'fr', 'pt-BR' to 'pt', 'uk-UA' to 'uk', unknown locales to English.

<ConsentBannerDefault locale="de" />
<ConsentBannerDefault locale="auto" /> {/* reads navigator.language */}

copy layers on top of the resolved locale, so you can pick a language and tweak one label:

<ConsentBannerDefault locale="de" copy={{ acceptLabel: 'Klar, akzeptieren' }} />

If you need a language not in the built-in set, pass a full copy object. PRs adding more locales are welcome — files live in src/shared/locales/.

Styling

The components inject a single <style> tag, once per page. Themes are CSS custom properties, so you can re-skin without forking:

.tb-root {
  --tb-radius: 12px;
  --tb-primary-bg: #6366f1;
  --tb-primary-fg: #fff;
}

The full set: --tb-bg, --tb-fg, --tb-fg-muted, --tb-border, --tb-shadow, --tb-primary-bg, --tb-primary-fg, --tb-secondary-bg, --tb-secondary-fg, --tb-link, --tb-radius, --tb-z.

Light/dark follows prefers-color-scheme. Pass theme="light" or theme="dark" to override.

Equal prominence — read this before re-styling

Accept All and Reject All on the first banner layer use the .tb-btn-equal class and look identical by default. This is deliberate. UK ICO and EU EDPB guidance treats unequal visual weight on those buttons as a dark pattern, and ICO has fined sites for it.

If you want to add brand colours, apply them to .tb-btn-equal so both buttons change together:

.tb-root .tb-btn-equal {
  background: #0070c4;
  color: #fff;
  border-color: #0070c4;
}

Do NOT use --tb-primary-bg to brand the Accept button alone — --tb-primary-bg is reserved for the modal Save button (a second-layer action where the user has already engaged with the customise flow, so equal-prominence rules don't apply the same way). Overriding it won't affect the first-layer banner buttons.

Banner vs notice

Use the banner when you have any consent-mode categories — most EU sites. It's a bottom bar with Accept all / Reject all / Customise, and Customise opens a modal with per-category toggles.

Use the notice when you only have notice-mode categories — typical for UK sites running just DUAA-exempt analytics. It's a small bottom-right card with Got it / Opt out.

If your site has both kinds of categories, use the banner. The customise modal lists notice-mode categories too, so the notice card stays out of the way.

Licence

MIT