Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps/docs/app/providers.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import * as React from "react";
import {HeroUIProvider, ToastProvider} from "@heroui/react";
import {HeroUIProvider} from "@heroui/react";
import {ThemeProvider as NextThemesProvider} from "next-themes";
import {ThemeProviderProps} from "next-themes";
import {useRouter} from "next/navigation";
Expand Down Expand Up @@ -44,7 +44,6 @@ export function Providers({children, themeProps}: ProvidersProps) {
return (
<ProviderWrapper>
<HeroUIProvider navigate={router.push}>
<ToastProvider />
<NextThemesProvider {...themeProps}>{children}</NextThemesProvider>
</HeroUIProvider>
</ProviderWrapper>
Expand Down
25 changes: 18 additions & 7 deletions apps/docs/content/components/toast/placement.raw.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
import {addToast, Button} from "@heroui/react";
import {addToast, ToastProvider, Button} from "@heroui/react";
import React from "react";

export default function App() {
const [placement, setPlacement] = React.useState("bottom-right");

return (
<div className="flex flex-wrap gap-2">
{["top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right"].map(
(position) => (
<>
<ToastProvider placement={placement} toastOffset={placement.includes("top") ? 60 : 0} />
<div className="flex flex-wrap gap-2">
{[
"top-left",
"top-center",
"top-right",
"bottom-left",
"bottom-center",
"bottom-right",
].map((position) => (
<Button
key={position}
variant={"flat"}
onPress={() => {
setPlacement(position);
addToast({
title: "Toast title",
description: "Toast displayed successfully",
Expand All @@ -18,8 +29,8 @@ export default function App() {
>
{position}
</Button>
),
)}
</div>
))}
</div>
</>
);
}
2 changes: 1 addition & 1 deletion apps/docs/content/docs/components/toast.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ Toast has the following slots:
},
{
attribute: "placement",
type: "bottom-right" | "bottom-left" | "bottom-center" | "top-right" | "top-left" | "top-center",
type: "bottom-right | bottom-left | bottom-center | top-right | top-left | top-center",
description: "The placement of the toast.",
default: "bottom-right"
},
Expand Down