Provides Cookie Preference Settings Dialog
Saves the preferences in LocalStorage with key = cookie-preference
, value = Map of preferenceName to boolean (true to allow, false to block)
Using a Fab
import { CookiePreference } from "mui-extended"; const myPage = () => { return ( <Tooltip title="Cookie Preferences"> <CookiePreference sx={{ position: "fixed", bottom: 25, right: 25 }} /> </Tooltip> ); };
This creates a Floating Action Button, when clicked opens a Cookie Preference Dialog
Props
AllFabProps
dialogProps
(Optional) CookiePreferenceDialogProps
Using Dialog
import { CookiePreferenceDialog } from "mui-extended"; const myPage = () => { return ( <CookiePreferenceDialog open={open} onClose={onClose} preferences={prefs} /> ); };
Use this component to display Cookie Preferences
Props
ResponsiveDialogProps
title
(Optional) ReactNode, Overrides Dialog Titledescription
(Optional) ReactNode, Overrides Descriptionnecessory
(Optional) Object of Type,
Overrides necessory preference section{ title?: string; description?: ReactNode }
preferences
Object of Type
Overrides preference sectionRecord<string, { default: boolean; title: string; description: ReactNode }>;
Using DefaultPreferences
import { defaultCookiePreferences } from "mui-extended";
Write an email to opensource@sodaru.com