> ## Documentation Index
> Fetch the complete documentation index at: https://neo.tvk.company/llms.txt
> Use this file to discover all available pages before exploring further.

# Toast

> A temporary notification overlay that appears at the bottom of the screen to provide feedback about operations or important information.

<Note>
  **Different from other Neo widgets**: Toast is used as a method call (`NeoToast.show()`) rather than a widget you place in your build tree. Call it inside callbacks—after button presses, successful API calls, or when operations complete—to provide instant user feedback.
</Note>

## Examples

<Tabs>
  <Tab title="Toast Types">
    <Frame caption="Preset toast types with automatic styling and behavior.">
      <img src="https://mintcdn.com/tvk/M1ZGdn8TY0ukkJe8/images/widgets/overlays/toast/toast_types_light.png?fit=max&auto=format&n=M1ZGdn8TY0ukkJe8&q=85&s=0e978c71589c5c9e937c0860fcf2ee30" noZoom className="block dark:hidden" width="1536" height="768" data-path="images/widgets/overlays/toast/toast_types_light.png" />

      <img src="https://mintcdn.com/tvk/M1ZGdn8TY0ukkJe8/images/widgets/overlays/toast/toast_types_dark.png?fit=max&auto=format&n=M1ZGdn8TY0ukkJe8&q=85&s=7d41923d6b2b06728adc729cae402817" noZoom className="hidden dark:block" width="1536" height="768" data-path="images/widgets/overlays/toast/toast_types_dark.png" />
    </Frame>

    <CodeGroup>
      ```dart Info Toast lines theme={null}
      NeoToast.show(
        ref: ref,
        label: "Viewing in read-only mode",
        type: .info,
      );
      ```

      ```dart Loading Toast lines theme={null}
      final toastId = NeoToast.show(
        ref: ref,
        label: "Uploading file...",
        type: .loading,
      );
      ```

      ```dart Success Toast lines theme={null}
      NeoToast.show(
        ref: ref,
        label: "Profile updated",
        type: .success,
      );
      ```

      ```dart Warning Toast lines theme={null}
      NeoToast.show(
        ref: ref,
        label: "Connection unstable",
        type: .warning,
      );
      ```

      ```dart Danger Toast lines theme={null}
      NeoToast.show(
        ref: ref,
        label: "Failed to save changes",
        type: .danger,
      );
      ```
    </CodeGroup>
  </Tab>

  <Tab title="With Description">
    <Frame caption="Toasts with additional description text for more context.">
      <img src="https://mintcdn.com/tvk/M1ZGdn8TY0ukkJe8/images/widgets/overlays/toast/toast_description_light.png?fit=max&auto=format&n=M1ZGdn8TY0ukkJe8&q=85&s=3f2c88ea076808c4adc6051269091f37" noZoom className="block dark:hidden" width="1536" height="384" data-path="images/widgets/overlays/toast/toast_description_light.png" />

      <img src="https://mintcdn.com/tvk/M1ZGdn8TY0ukkJe8/images/widgets/overlays/toast/toast_description_dark.png?fit=max&auto=format&n=M1ZGdn8TY0ukkJe8&q=85&s=e30b962affee0052fda55d53df924ae0" noZoom className="hidden dark:block" width="1536" height="384" data-path="images/widgets/overlays/toast/toast_description_dark.png" />
    </Frame>

    <CodeGroup>
      ```dart Toast with Description lines theme={null}
      NeoToast.show(
        ref: ref,
        label: "Export completed",
        description: "Your data has been exported to Downloads/report.pdf",
        type: .success,
      );
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Update Toast">
    <Frame caption="Dynamically update existing toasts for progress feedback.">
      <img src="https://mintcdn.com/tvk/M1ZGdn8TY0ukkJe8/images/widgets/overlays/toast/toast_update_light.png?fit=max&auto=format&n=M1ZGdn8TY0ukkJe8&q=85&s=cee590fdcd8002016055b4d4acc469ee" noZoom className="block dark:hidden" width="1536" height="384" data-path="images/widgets/overlays/toast/toast_update_light.png" />

      <img src="https://mintcdn.com/tvk/M1ZGdn8TY0ukkJe8/images/widgets/overlays/toast/toast_update_dark.png?fit=max&auto=format&n=M1ZGdn8TY0ukkJe8&q=85&s=ae371b87dbe0154c670b4180781272a4" noZoom className="hidden dark:block" width="1536" height="384" data-path="images/widgets/overlays/toast/toast_update_dark.png" />
    </Frame>

    <CodeGroup>
      ```dart Update Progress lines theme={null}
      // Start with loading toast
      final toastId = NeoToast.show(
        ref: ref,
        label: "Uploading file...",
        type: .loading,
      );

      // Update to success when done
      NeoToast.update(
        ref: ref,
        id: toastId,
        label: "File uploaded successfully",
        type: .success,
        description: "Available in your documents folder",
      );
      ```
    </CodeGroup>
  </Tab>
</Tabs>

## Methods

### NeoToast.show()

Displays a toast notification at the bottom right of the screen. Returns a string ID that can be used to update the toast later.

#### Required Parameters

<ParamField path="ref" type="WidgetRef" required>
  The widget reference from a `ConsumerWidget` or `HookConsumerWidget`, used to access the toast provider.
</ParamField>

<ParamField path="label" type="String" required>
  The main text message to display in the toast.
</ParamField>

<ParamField path="type" type="NeoToastType" required>
  The preset type that determines styling, icon, and behavior. Use presets for consistent UX.
</ParamField>

#### Optional Parameters

<ParamField path="description" type="String">
  Additional text displayed below the main label for extra context.
</ParamField>

<ParamField path="icon" type="PhosphorIconData">
  Custom icon to override the preset icon from `type`.
</ParamField>

<ParamField path="color" type="Color">
  Custom color to override the preset color from `type`.
</ParamField>

<ParamField path="autoDismiss" type="bool">
  Custom auto-dismiss behavior to override the preset from `type`.
</ParamField>

<ParamField path="isIconRotating" type="bool">
  Whether the icon should rotate continuously (e.g. for custom loading states).
</ParamField>

<ParamField path="showDismissButton" type="bool">
  Whether to show a dismiss button. If null, determined by `autoDismiss` setting.
</ParamField>

### NeoToast.update()

Updates an existing toast with new content. Perfect for progress feedback or changing toast context.

#### Required Parameters

<ParamField path="ref" type="WidgetRef" required>
  The widget reference to access the toast provider.
</ParamField>

<ParamField path="id" type="String" required>
  The ID returned from `NeoToast.show()` to identify which toast to update.
</ParamField>

#### Optional Parameters

<ParamField path="type" type="NeoToastType">
  New preset type to apply. Updates styling, icon, and behavior.
</ParamField>

<ParamField path="label" type="String">
  New main text message.
</ParamField>

<ParamField path="description" type="String">
  New description text.
</ParamField>

<ParamField path="icon" type="PhosphorIconData">
  New custom icon.
</ParamField>

<ParamField path="color" type="Color">
  New custom color.
</ParamField>

<ParamField path="autoDismiss" type="bool">
  New auto-dismiss behavior.
</ParamField>

<ParamField path="isIconRotating" type="bool">
  New icon rotation state.
</ParamField>

<ParamField path="showDismissButton" type="bool">
  New dismiss button visibility.
</ParamField>

## Enums

### NeoToastType

Predefined toast configurations that automatically handle styling and behavior.

* `info`: General information
* `loading`: Ongoing operations with spinner
* `success`: Successful actions with checkmark icon
* `warning`: Cautionary messages with warning icon
* `danger`: Error states with error icon

## Best Practices

* **Use Presets**: Leverage `NeoToastType` presets for consistent user experience and automatic behavior
* **Progress Updates**: Use `NeoToast.update()` for operations that transition between states (loading → success/error)
* **Appropriate Duration**: Trust preset auto-dismiss behavior—success/info toasts dismiss automatically, errors state require user action, loading state stays until type is changed or programatically dismissed
* **Description Usage**: Use `description` for helpful details like file paths, error codes, or next steps
* **Enhanced Feedback**: Combine with [`NeoHaptics`](/utilities/haptics) for error toasts to provide tactile feedback alongside visual notifications

## Integration Notes

* **Advanced Stacking**: Multiple toasts stack vertically with dynamic height calculation and smooth repositioning animations
* **Bounce Animation**: Toasts briefly scale up when updated, providing visual feedback for content changes, grabbing user's attention
* **Swipe-to-Dismiss**: When a toast has `autoDismiss` enabled or a dismiss control visible, users can drag it horizontally to dismiss. Dragging past \~25% of the toast width triggers dismissal with a light haptic. Releasing short of the threshold springs the toast back to its resting position.
