Home / File/ toast-with-action.tsx — ui Source File

toast-with-action.tsx — ui Source File

Architecture documentation for toast-with-action.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.

File tsx ComponentRegistry ChartRegistry 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  58978122_babc_a0cf_7705_5073effd5a88["toast-with-action.tsx"]
  1d9c6c27_a443_c5fd_35f3_e80b7125bc9f["use-toast"]
  58978122_babc_a0cf_7705_5073effd5a88 --> 1d9c6c27_a443_c5fd_35f3_e80b7125bc9f
  d418ad18_b947_f4e5_6e4c_01100d7a63e4["button"]
  58978122_babc_a0cf_7705_5073effd5a88 --> d418ad18_b947_f4e5_6e4c_01100d7a63e4
  873e9420_c0bc_78ed_8630_206ed9c8f402["toast"]
  58978122_babc_a0cf_7705_5073effd5a88 --> 873e9420_c0bc_78ed_8630_206ed9c8f402
  style 58978122_babc_a0cf_7705_5073effd5a88 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import { useToast } from "@/registry/default/hooks/use-toast"
import { Button } from "@/registry/default/ui/button"
import { ToastAction } from "@/registry/default/ui/toast"

export default function ToastWithAction() {
  const { toast } = useToast()

  return (
    <Button
      variant="outline"
      onClick={() => {
        toast({
          title: "Uh oh! Something went wrong.",
          description: "There was a problem with your request.",
          action: <ToastAction altText="Try again">Try again</ToastAction>,
        })
      }}
    >
      Show Toast
    </Button>
  )
}

Subdomains

Functions

Dependencies

  • button
  • toast
  • use-toast

Frequently Asked Questions

What does toast-with-action.tsx do?
toast-with-action.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in toast-with-action.tsx?
toast-with-action.tsx defines 1 function(s): ToastWithAction.
What does toast-with-action.tsx depend on?
toast-with-action.tsx imports 3 module(s): button, toast, use-toast.
Where is toast-with-action.tsx in the architecture?
toast-with-action.tsx is located at deprecated/www/registry/default/examples/toast-with-action.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: deprecated/www/registry/default/examples).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free