Crate yew_consent

source ·
Expand description

Managing consent with Yew

Usage

The idea is to ask the user for some kind of consent, which is modeled by ConsentState plus the additional type T (which can also be ()) if no further specializations are needed.

Wrap the main content of your application with the component::Consent component. It will load the consent state from the browser storage, and then either show the ask content, which is responsible to get the consent state. Or it will show the “children”, wrapping them with the consent state as defined by the user.

All component below the component::Consent component can use the hook::use_consent hook, to fetch the ConsentState. They can also use the hook::use_consent_context to change the consent state later on.

Examples

See the example project in the example folder.

Modules

Enums