gluestack-ui logo
Get Updates
Prompt to React Native UI
Home
Components
Hooks
Apps
MCP Server
Guides
Home
Overview
IntroductionQuick Start
Getting Started
InstallationTooling SetupVS Code ExtensionsFigma UI KitCLIgluestack-ui-nativewind-utils
Core Concepts
AccessibilityUniversal
Performance
Benchmarks
Theme Configuration
Default TokensCustomizing ThemeDark Mode
Components
All Components
Typography
HeadingrscTextrsc
Layout
BoxrscCenterrscDividerHStackrscVStackrscGridalpha, rsc
Feedback
AlertProgressSpinnerToast
Data Display
BadgeCardrscTablealpha
Forms
ButtonCheckboxFormControlInputLinkPressableRadioSelectSliderSwitchTextarea
Overlay
AlertDialogDrawerMenuModalPopoverPortalTooltip
Disclosure
ActionsheetAccordionBottomSheetalpha
Media And Icons
AvatarImageIconrsc
Others
FabSkeletonalpha, rsc
Hooks
useBreakPointValue
useMediaQuery
Apps
Dashboard App
Kitchensink App
Todo App
Starter Kit
MCP Server
MCP Server
Guides
Recipes
LinearGradient
Tutorials
Building Ecommerce App
More
Upgrade to v2Upgrade to v3FAQsReleasesRoadmapTroubleshootingDiscord FAQs

Toast

gluestack-ui Toast component for React Native lets you show toast messages effortlessly. Improve your Toast component with flexible placement, duration, and actions. This is an illustration of Toast component.
action
variant

Platform Support

The Tooltip component is currently only supported on web platform. Native mobile support (iOS/Android) is not available at this time. For more information, see issue #1555.

Installation

Run the following command:

npx gluestack-ui add toast

API Reference

To use this component in your project, include the following import statement in your file.
import { useToast, Toast } from '@/components/ui/toast';
anatomy-imageanatomy-image
export default () => (
  <Toast>
    <ToastTitle />
    <ToastDescription />
  </Toast>
);

Component Props

This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.

Toast

It inherits all the properties of React Native's View component.
PropTypeDefaultDescription
duration
number or null5000The delay before the toast hides (in milliseconds). If set to null, toast will never dismiss.
onCloseComplete
()=>-Callback function to run side effects after the toast has closed.
placement
'top'| 'top right' | 'top left' | 'bottom' | 'bottom left' | 'bottom right'bottomPosition of toast on the web page.
render?: (props: any)
ReactNode-Renders a toast component
avoidKeyboard
boolfalseIf true and the keyboard is opened, the Toast will move up equivalent to the keyboard height.
containerStyle
ViewStyle-Container style object for the toast.

ToastTitle

Contains all Text related layout style props and actions. It inherits all the properties of React Native's Text component.

ToastDescription

Contains all Text related layout style props and actions. It inherits all the properties of React Native's Text component.

Accessibility

We have outlined the various features that ensure the Toast component is accessible to all users, including those with disabilities. These features help ensure that your application is inclusive and meets accessibility standards.Adheres to the WAI-ARIA design pattern.

Keyboard

  • Tab + Enter
    : Triggers the toast's action.

Screen Reader

  • VoiceOver: When the toast is focused, the screen reader will announce the toast's title.

Props

Toast component is created using View component from react-native. It extends all the props supported by React Native View and the props mentioned below.

Toast

NameValueDefault
action
error | warning | success | info | attention
attention
variant
solid | outline | accent
solid

Examples

The Examples section provides visual representations of the different variants of the component, allowing you to quickly and easily determine which one best fits your needs. Simply copy the code and integrate it into your project.

Toast in note talking platform

Social media notification

Software update toast

Message sent toast

Edit this page on GitHub
Go backSpinner
Up nextBadge
Go backSpinner
Up nextBadge