
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@workday/canvas-kit-react-cookie-banner
Advanced tools
Cookie banner component.
yarn add @workday/canvas-kit-react
or
yarn add @workday/canvas-kit-react-cookie-banner
Fixes a cookie banner to the bottom of the web page.
Can be configured with a "Cookie Settings" element and a custom notice.
import CookieBanner from '@workday/canvas-kit-react-cookie-banner'
<CookieBanner
onAccept={this.onAccept}
isClosed={this.state.acceptedCookies}
/>
<CookieBanner
onAccept={this.onAccept}
isClosed={this.state.acceptedCookies}
onClickSettings={this.openSettings}
notice="Custom notice"
/>
<CookieBanner
onAccept={this.onAccept}
isClosed={this.state.acceptedCookies}
onClickSettings={this.openSettings}
notice={`${CookieBanner.DefaultNotice} This is appended.`}
/>
<CookieBanner
onAccept={this.onAccept}
isClosed={this.state.acceptedCookies}
notice={<Component />}
/>
DefaultNotice: stringWe use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we’ll assume that you are willing to receive cookies.
<CookieBanner
onAccept={this.onAccept}
isClosed={this.state.acceptedCookies}
onClickSettings={this.openSettings}
notice={`${CookieBanner.DefaultNotice} This is appended.`}
/>
onAccept: (e: React.MouseEvent<HTMLButtonElement>) => voidCallback executed upon accepting cookies. The function should set
isClosedto true.
isClosed: booleanWhether or not the banner is closed.
Default: false
onClickSettings: (e: React.MouseEvent<HTMLButtonElement>) => voidCallback executed upon clicking the "Cookie Settings" button. Adding this will automatically display the "Cookie Settings" button.
Default: undefined
notice: React.ReactNodeCustom cookie notice text or element to display.
Default: CookieBanner.DefaultNotice
settingsLabel: stringDefault label for cookie settings
Default: 'Cookie Settings'
FAQs
Did you know?

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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.