npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-floatify

v1.1.6

Published

A lightweight, customizable toast notification library for React.

Readme

react-floatify

A lightweight, customizable toast notification library for React.

Built for React using React, TypeScript, Framer Motion for animation and SCSS for styling.

Test it out in this custom playground built for react-floatify : https://toasty-playground-ten.vercel.app/

Features

  • Multiple toast types: success, error, warning, default
  • Variants: regular, outlined, contained
  • Adjustable spacing, shadows, position and pop-in-out directions
  • Configurable duration + optional progress bar
  • Option to disable animations
  • Customizable fontSize and iconSize
  • Override styles using sx
  • Tiny, tree-shakable, easy to use

Installation

npm install react-floatify

Usage

Wrap your app with the ToastProvider:

import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import { ToastProvider } from "react-floatify";

ReactDOM.createRoot(document.getElementById("root")!).render(
  <React.StrictMode>
    <ToastProvider>
      <App />
    </ToastProvider>
  </React.StrictMode>
);

Import CSS and Trigger a toast with the useToast hook:

import { useToast } from "react-floatify";
import "react-floatify/dist/react-floatify.css";

function Example() {
  const { addToast } = useToast();

  return (
    <button
      onClick={() =>
        addToast("Hello World!", {
          type: "success",
          variant: "contained",
          spacing:"regular",
          duration: 4,
          fontSize: 16,
          iconSize: 20,
          showProgress: true,
        })
      }
    >
      Show Toast
    </button>
  );
}

TypeScript Usage

If you’re using TypeScript and your type or variant values come from component state, you should import the provided types to get full type safety:

import { useToast, type ToastType, type ToastVariant } from "react-floatify";

const [type, setType] = useState<ToastType>("default");
const [variant, setVariant] = useState<ToastVariant>("regular");

Options

| Option | Type | Default | Description | |--------------------|-----------------------------------------------|------------|---------------------------------------| | type | "success" | "error" | "warning" | "default" | "default" | Toast style | | variant | "regular" | "outlined" | "contained" | "regular" | Visual variant | | duration | number | 5 | Duration in seconds | | spacing | "small" | "regular" | "large" | "regular | Message Padding | | disableAnimation | boolean | false | Disable entry/exit animations | | elevation | number | 3 | Box Shadow on Toast Container | | showProgress | boolean | true | Show progress bar | | slideFrom | "left"|"right"|"bottom"|"top" | "right" | Slide-from direction (slides back into that direction) | | position | "top left"|"top right"|"top center"|"bottom left" | "bottom right"|"bottom center" | Position on Screen | | showProgress | boolean | true | Show progress bar | | showIcon | boolean | true | Show Icon (type: "default" has no icon) | | fontSize | string | number | 14 | Font size for message text | | iconSize | number | 17 | Icon size | | sx | React.CSSProperties | {} | Inline style overrides |

position prop must be used in ToastProvider

Example usage:

<ToastProvider position="bottom center">...</ToastProvider>

DOM Structure

Each toast is rendered inside a .Toast-stack-modal.
The basic DOM structure looks like this for a toast with type:"success", variant:"regular", iconSize:17, spacing:"regular" and showProgress:true:

<div class="Toast-stack-modal">
  <div class="Toasty-container success regular">
    <div class="Toasty-message regular-spacing">
      <CheckCircle size={17}/> // lucide-react icon
      Welcome to Floatify
    </div>
    <div class="Toasty-progress-container">
      <div class="Toasty-progress-bar success"></div>
    </div>
  </div>
</div>