Skip to content

Commit 2cdf9a3

Browse files
committed
updated readme
1 parent f887c5a commit 2cdf9a3

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ return [
5050
*/
5151
'highlight_color' => null,
5252

53+
/**
54+
* Floating banner toggle
55+
* if false, the banner toggle will not be displayed.
56+
* You need to add "data-cookie-solution-toggle" attribute to an element to open the banner.
57+
*/
58+
'toggle_enabled' => true,
59+
5360
/**
5461
* Cookie toggle position (left or right).
5562
*/
@@ -206,14 +213,26 @@ If you need a more advanced customization, you can edit the toggle position with
206213

207214
You can change the toggle z-index by changing the `--cs--toggle-z-index` CSS variable. The default value is `9999`.
208215

216+
#### Disabling toggle
217+
218+
Sometimes you may want to disable the default floating toggle and use your own toggle button.
219+
You can do this by setting the `toggle_enabled` config value to `false`.
220+
Then you need to add the `data-cookie-solution-toggle` attribute to an element in your layout, like this:
221+
222+
```html
223+
<button data-cookie-solution-toggle>
224+
Toggle Cookie Banner
225+
</button>
226+
```
227+
209228
#### Views
210229

211230
If you want to customize the views, you can publish them with `php artisan vendor:publish --tag="cookie-solution-views"` and style them however you like.
212231
The `<cookie-solution-policy-formatter/>` custom component is used to apply the default styles, you can safely remove it to customize the views.
213232

214233
## Checking status
215234

216-
You can check the user's consent status from laravel using the `CookieSolution::status()` method,
235+
You can check the user's consent status from laravel using the `CookieSolution::status()` method,
217236
which returns a `CookieSolutionStatus` object with helpers to check if a purpose has been accepted.
218237

219238
## Testing

0 commit comments

Comments
 (0)