πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
Sign inDemoInstall
Socket

@consentry/ui

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@consentry/ui

Composable UI components for the Consentry consent manager. Built with Emotion and designed for use with @consentry/core or @consentry/next.

0.1.7
latest
Source
npm
Version published
Weekly downloads
44
-50%
Maintainers
1
Weekly downloads
Β 
Created
Source

@consentry/ui

Headless and fully customizable React components for the Consentry consent manager. Includes modals, banners, toggles, and more β€” built for flexibility and themeability.

✨ Overview

@consentry/ui is the official component library for @consentry/core and @consentry/next. It provides:

  • 🎨 Customizable cookie banner and settings modal
  • βš™οΈ Headless, themeable, and styled with Emotion + Framer Motion
  • 🧩 Fully controlled or automatic modes
  • πŸ”„ Animations and accessibility baked-in
  • πŸ§‘β€πŸ’» Easy integration with any config or hook-based logic

πŸ“¦ Installation

npm install @consentry/ui @consentry/core @consentry/next

βš™οΈ Usage

1. Wrap your app with ConsentManagerProvider (from @consentry/next)

"use client";
import { ConsentManagerProvider } from "@consentry/next";
import ConsentManager from "@consentry/ui";
import consentConfig from "./consent.config";

export default function RootLayout({ children }) {
  return (
    <ConsentManagerProvider config={consentConfig}>
      <ConsentManager mode="modal" dark={false} />
      {children}
    </ConsentManagerProvider>
  );
}

🧠 Features

🧱 ConsentManager Component

The main UI component. Renders:

  • βœ… A floating settings button (optional)
  • βœ… A cookie banner (auto-displayed if no prior consent)
  • βœ… A settings modal with toggleable cookie categories

Props

PropTypeDefaultDescription
mode"modal" | "top" | "bottom"β€”Defines banner layout
darkbooleanfalseEnables dark mode styling
hideSettingsButtonbooleanfalseHides the floating button
categoriesCookieCategory[]predefinedOverride default cookie categories
labelsobjectpredefinedCustomize banner and modal text
classNamesobjectβ€”Customize class names per section

πŸͺ Control from Anywhere

To open the settings modal programmatically (e.g., from a Privacy page):

import { openConsentSettings } from "@consentry/ui";

<button onClick={() => openConsentSettings()}>Open Cookie Settings</button>;

🎨 Customization

You can customize:

  • Text (labels.banner, labels.modal)
  • Style (classNames.container, classNames.title, etc.)
  • Behavior (dark, mode, hideSettingsButton)

πŸ“„ License

MIT β€” Copyright Β© 2025
Mustafa ONAL
github.com/consentryio

Keywords

cookie-consent

FAQs

Package last updated on 16 Apr 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