Native Toast Message

Content Type: Widget
Categories: Data

Overview

The Toast component provides a way to display temporary messages or notifications to the user.

Documentation

The Toast component provides a way to display temporary messages or notifications to the user.

Features:

1. type (string, default: 'success')

  • Specifies the type of the toast. Available values: success, error, info.
  • To extend or overwrite toast types, refer to the documentation for details.

2. text1 (string)

  • Sets the first line of text for the toast message.

3. text2 (string)

  • Sets the second line of text for the toast message.

4. position (string, default: 'top')

  • Determines the position of the toast on the screen. Available values: top, bottom.

5. visibilityTime (number, default: 4000)

  • Specifies the number of milliseconds after which the toast automatically hides.
  • This prop takes effect only when autoHide is set to true.

6. autoHide (boolean, default: true)

  • When set to true, the toast will automatically hide after the specified visibilityTime milliseconds.

7. topOffset (number, default: 40)

  • Sets the offset from the top of the screen (in pixels).
  • This prop has an effect only when the position is set to top.

8. bottomOffset (number, default: 40)

  • Sets the offset from the bottom of the screen (in pixels).
  • This prop has an effect only when the position is set to bottom.

9. keyboardOffset (number, default: 10)

  • Sets the offset from the keyboard (in pixels). This prop is only applicable when the position is set to bottom, and the keyboard is visible (iOS only).

10. onHide (() => void)

  • A callback function that is called when the toast hides.

11. onPress (() => void)

  • A callback function that is called when the toast is pressed.

Issues, suggestions and feature requests

https://github.com/bharathidas/NativeToastMessage/issues

Releases

Version: 1.0.0
Framework Version: 9.12.4
Release Notes: The Toast component provides a way to display temporary messages or notifications to the user. **Features:** **1.** **type** (string, default: 'success') - Specifies the type of the toast. Available values: success, error, info. - To extend or overwrite toast types, refer to the documentation for details. **2.** **text1** (string) - Sets the first line of text for the toast message. **3.** **text2** (string) - Sets the second line of text for the toast message. **4.** **position** (string, default: 'top') - Determines the position of the toast on the screen. Available values: top, bottom. **5.** **visibilityTime** (number, default: 4000) - Specifies the number of milliseconds after which the toast automatically hides. - This prop takes effect only when autoHide is set to true. - **6.** **autoHide** (boolean, default: true) - When set to true, the toast will automatically hide after the specified visibilityTime milliseconds. **7.** **topOffset** (number, default: 40) - Sets the offset from the top of the screen (in pixels). - This prop has an effect only when the position is set to top. **8.** **bottomOffset** (number, default: 40) - Sets the offset from the bottom of the screen (in pixels). - This prop has an effect only when the position is set to bottom. **9.** **keyboardOffset** (number, default: 10) - Sets the offset from the keyboard (in pixels). This prop is only applicable when the position is set to bottom, and the keyboard is visible (iOS only). **10.** **onHide** (() => void) - A callback function that is called when the toast hides. **11.** **onPress** (() => void) - A callback function that is called when the toast is pressed. **Issues, suggestions and feature requests** [https://github.com/bharathidas/NativeToastMessage/issues](https://github.com/bharathidas/NativeToastMessage/issues)