diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d925b3..ac29385 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [next] + +- added `customButtonProps` that allows to use custom props with the button component. Specifically useful for library buttons components, for e.g. MUI Button. + ## [[7.2.1]](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/7.2.1) - hideOnDecline added to typescript files diff --git a/README.md b/README.md index 35f82be..626d869 100644 --- a/README.md +++ b/README.md @@ -183,6 +183,7 @@ That option would be interesting if you want to allow user to change their conse | customContainerAttributes | object | `{}` | Allows you to set custom (data) attributes on the container div | | onOverlayClick | function | `() => {}` | allows you to react to a click on the overlay | | acceptOnOverlayClick | boolean | false | Determines whether the cookies should be accepted after clicking on the overlay | +| customButtonProps | object | `{}` | Allows you to set custom props on the button component | ## Debugging it diff --git a/src/index.d.ts b/src/index.d.ts index b63e92d..0542674 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -47,6 +47,7 @@ export interface CookieConsentProps { acceptOnScrollPercentage?: number; customContentAttributes?: object; customContainerAttributes?: object; + customButtonProps?: object; } export default class CookieConsent extends React.Component {} diff --git a/src/index.js b/src/index.js index eddb807..c373228 100644 --- a/src/index.js +++ b/src/index.js @@ -292,6 +292,7 @@ class CookieConsent extends Component { ariaDeclineLabel, customContainerAttributes, customContentAttributes, + customButtonProps, } = this.props; let myStyle = {}; @@ -359,6 +360,7 @@ class CookieConsent extends Component { // add accept button buttonsToRender.push(