Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
https://poply.dev
🎉 Lightweight toast component for React 🎉
# pnpm (recommended):
pnpm add poply
# npm:
npm install poply
# yarn:
yarn add poply
Add <Toaster />
to your app component:
import { Toaster, toast } from 'poply';
function App() {
return (
<div>
<button onClick={() => toast.info('Hello world!')}>Toast</button>
<Toaster />
</div>
)
}
Import Toaster
and render it inside of a Client Coponent:
// app/toaster-provider.tsx
'use client'
import { Toaster } from 'poply';
export default function ToasterProvider({ children }: { children: React.ReactNode }) {
return (
<>
{children}
<Toaster />
</>
);
}
As your provider has been marked as a Client Component, your Server Component can now directly render it:
// app/layout.tsx
import ToasterProvider from './toaster-provider';
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html>
<body>
<ToasterProvider>
{children}
</ToasterProvider>
</body>
</html>
);
}
Toaster component accepts following props:
Prop | Description |
---|---|
bgColor | Color of toast background |
textColor | Color of text and close icon |
customComponent | Custom component to render toast |
position | Position of toast container |
maxToasts | Maximum number of toasts to show |
maxToastsPerMessage | Maximum number of toasts per message |
import { Toaster, toast } from 'poply';
import { CustomToast } from './components/custom-toast';
function App() {
return (
<div>
<button onClick={() => toast.info('Hello world!')}>Toast</button>
<Toaster customComponent={({ message, type }) => <CustomToast message={message} type={type} />} />
</div>
)
}
Licensed under MIT
FAQs
Poply is lightweight toast library for React
We found that poply demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.