Feedback and status
Toast
transient · ToastProvider is in the root layout
function ToastDemo() { const toast = useToast(); return ( <View className="flex-row flex-wrap gap-2"> <Button size="sm" variant="outline" onPress={() => toast.success('Saved')}> <Text>Success</Text> </Button> <Button size="sm" variant="outline" onPress={() => toast.error('Something went wrong')}> <Text>Error</Text> </Button> <Button size="sm" variant="outline" onPress={() => toast.warning('Check your details')}> <Text>Warning</Text> </Button> <Button size="sm" variant="outline" onPress={() => toast.info('Copied to clipboard')}> <Text>Info</Text> </Button> </View> );}Usage
Transient, bottom-anchored, tap to dismiss. Persistent messages use Alert.
API
const toast = useToast(); toast.success("Saved") · .error · .warning · .infoGet it
Already in every copy of the native kit:
import { useToast, ToastProvider } from '@/components/kit/toast';Details
- Exports
useToast,ToastProvider- Packages
- lucide-react-native@^1.21.0, react-native-safe-area-context@~5.7.0
- Installs with
- @halftone-native/icon, @halftone-native/lib-haptics, @halftone-native/lib-reduced-motion, @halftone-native/lib-theme, @halftone-native/lib-utils, @halftone-native/text
- Also searched as
- snackbar, notification, message, copied
- Registry JSON
- /r/native/toast.json
<Row> <Button variant="outline" onClick={() => toast.success('Invoice sent')}> Success </Button> <Button variant="outline" onClick={() => toast('Project archived', { action: { label: 'Undo', onClick: () => toast('Restored') } })}> With undo </Button></Row>Usage
For “done” and “undo”, not for errors that need action (use Alert next to the cause).
API
import { toast } from 'sonner'; toast.success('Saved')Get it
Already in every copy of the web kit:
import { Toaster } from '@/components/ui/sonner';Details
- Exports
Toaster- Also searched as
- sonner, snackbar, notification
- Upstream
- Unchanged from shadcn/ui; installs from their registry.
Agents: the whole registry is at /llms.txt.