Native only
Permission primer
shown BEFORE the OS dialog · the skip is not optional
function PermissionPrimerDemo() { const [done, setDone] = React.useState<'allowed' | 'skipped' | null>(null); return ( <View className="w-full gap-3"> <Card className="w-full px-2 py-2"> {done ? ( <View className="items-center gap-2 px-6 py-8"> <Spot icon={done === 'allowed' ? CheckIcon : BellOffIcon} size="lg" tone={done === 'allowed' ? 'success' : 'muted'} className="mb-4" /> <Text variant="h4" className="text-center"> {done === 'allowed' ? 'Alerts are on' : 'No alerts, then'} </Text> <Text className="text-muted-foreground max-w-xs text-center"> {done === 'allowed' ? 'This prototype can tell you when something changes.' : 'Everything still works — updates appear inside the app instead.'} </Text> </View> ) : ( <PermissionPrimer capability="notify" onAllow={() => setDone('allowed')} onSkip={() => setDone('skipped')} /> )} </Card> {done ? ( <Button variant="outline" onPress={() => setDone(null)}> <Text>Show the primer again</Text> </Button> ) : null} </View> );}Usage
Show this before the OS dialog, never instead of it. The skip is not optional: a prototype must never dead-end on a permission the viewer declined.
API
<PermissionPrimer capability variant="inline|sheet" onAllow onSkip skipLabel? />Get it
Already in every copy of the native kit:
import { PermissionPrimer } from '@/components/kit/permission-primer';Details
- Exports
PermissionPrimer- Packages
- lucide-react-native@^1.21.0
- Installs with
- @halftone-native/button, @halftone-native/lib-native, @halftone-native/lib-utils, @halftone-native/sheet, @halftone-native/spot, @halftone-native/text
- Also searched as
- permission, allow, prompt, ask, privacy
- Registry JSON
- /r/native/permission-primer.json
Agents: the whole registry is at /llms.txt.