MUI Extended UI Components

Cookie Preference


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)

Usage

  • 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

    • All ResponsiveDialogProps
    • title (Optional) ReactNode, Overrides Dialog Title
    • description (Optional) ReactNode, Overrides Description
    • necessory (Optional) Object of Type,
      { title?: string; description?: ReactNode }
      Overrides necessory preference section
    • preferences Object of Type
      Record<string, { default: boolean; title: string; description: ReactNode }>;
      Overrides preference section
  • Using DefaultPreferences

    import { defaultCookiePreferences } from "mui-extended";
Demo
Find the Cookie Fab Down Right there
Does this page need improvements?
Edit This Page in GitHub
Did this page help you?
Provide feedback in the GitHub Discussion Page
Need More help?

Write an email to opensource@sodaru.com