Package-level declarations
Types
Link copied to clipboard
data class KConsentCategory(val type: KConsentCategoryType, val title: String, val description: String, val isRequired: Boolean = false, val isEnabledByDefault: Boolean = false, val icon: ImageVector = Icons.Outlined.Shield)
Describes a single consent category with metadata.
Link copied to clipboard
Standard cookie & privacy consent categories.
Link copied to clipboard
Link copied to clipboard
data class KConsentPreferences(val selections: Map<KConsentCategoryType, Boolean> = mapOf(
KConsentCategoryType.NECESSARY to true,
KConsentCategoryType.ANALYTICS to false,
KConsentCategoryType.MARKETING to false,
KConsentCategoryType.FUNCTIONAL to false
))
Holds user choices for consent categories.
Functions
Link copied to clipboard
fun KConsentBanner(onAcceptAll: () -> Unit, onRejectOptional: () -> Unit, onSaveCustomPreferences: (KConsentPreferences) -> Unit, modifier: Modifier = Modifier, title: String = "We respect your privacy", description: String = "We use cookies and similar technologies to enhance navigation, analyze site traffic, and personalize content. You can manage your choices at any time.", categories: List<KConsentCategory> = KDefaultConsentCategories, initialPreferences: KConsentPreferences = KConsentPreferences(), shape: Shape = MaterialTheme.kindlingShapes.radiusLg, elevation: Dp = 4.dp)
Complete, ready-to-use c15t-style Privacy & Consent Banner / Card component.
Link copied to clipboard
fun KConsentCategoryRow(category: KConsentCategory, isEnabled: Boolean, onToggle: (Boolean) -> Unit, modifier: Modifier = Modifier, shape: Shape = MaterialTheme.kindlingShapes.radiusMd)
Link copied to clipboard
fun KConsentPreferencesDialog(categories: List<KConsentCategory>, currentPreferences: KConsentPreferences, onSavePreferences: (KConsentPreferences) -> Unit, onDismiss: () -> Unit, modifier: Modifier = Modifier)
Modal dialog for granular consent customization (c15t preference modal).
Link copied to clipboard
fun KConsentProvider(initialPreferences: KConsentPreferences? = null, categories: List<KConsentCategory> = KDefaultConsentCategories, onConsentChange: (KConsentPreferences) -> Unit = {}, content: @Composable () -> Unit)
Top-level Provider that manages state and exposes it down the tree.
Link copied to clipboard
Custom Hook: Access consent state and actions anywhere in the Compose hierarchy.