Token导航 LogoToken导航

Agent Skill · 前端设计

sileo-react-toasts(sileo React toasts 前端)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

sileo-react-toasts 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 4,112。

总安装 994周安装 41GitHub Stars 公开资料未说明下载 325核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sileo-react-toasts(sileo React toasts 前端)
来源仓库:https://github.com/xoverlap/sileo-skill
仓库路径:skills/sileo-react-toasts
安装命令:
npx skills add https://github.com/xoverlap/sileo-skill --skill sileo-react-toasts
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/xoverlap/sileo-skill --skill sileo-react-toasts

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

sileo-react-toasts 用于辅助前端页面、组件和样式开发,适合生成或审查 React 相关代码。它能帮助整理组件结构,提升前端开发效率。使用时需结合项目现有设计系统和构建方式,避免生成孤立片段;涉及页面改动时应配合本地预览确认效果。

通过 npx skills add 命令从 GitHub 仓库安装,具体用法可参考原始 README 文档。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/sileo-react-toasts

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/xoverlap/sileo-skill --skill sileo-react-toast…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

sileo-react-toasts 怎么安装?

在终端执行 npx skills add https://github.com/xoverlap/sileo-skill --skill sileo-react-toasts。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

sileo-react-toasts 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

sileo-react-toasts 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

sileo-react-toasts 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

sileo-react-toasts 用的人多吗?

公开数据是累计安装 994 次,近一周安装 41 次,下载 325 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

sileo-react-toasts 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
sileo-react-toasts

sileo React toasts 前端 · 本页

994—需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

SKILL: Sileo (React Toast Notifications)

Official documentation: https://sileo.aaryan.design/docs API Reference: https://sileo.aaryan.design/docs/api Toaster API: https://sileo.aaryan.design/docs/api/toaster Styling Guide: https://sileo.aaryan.design/docs/styling Playground: https://sileo.aaryan.design/play GitHub: https://github.com/hiaaryan/sileo

What is Sileo?

Sileo is a tiny, opinionated, physics-based toast component for React. It uses gooey SVG morphing (via an feGaussianBlur + feColorMatrix filter chain) and spring animations (powered by motion/react, formerly Framer Motion) to create buttery-smooth notifications that look beautiful by default with zero configuration.

Sileo is not a general-purpose notification center. It is a highly polished, visually distinctive toast system designed for single-line feedback messages with optional expandable descriptions.

Key characteristics:

  • Framework: React only (ships with "use client" directive for Next.js App Router compatibility)
  • Peer dependency: motion (spring physics engine, motion/react)
  • Architecture: SVG-based rendering with gooey blob morphing between pill (collapsed) and card (expanded) states
  • TypeScript-first: All types are exported (SileoOptions, SileoPosition, SileoState, SileoStyles, SileoButton)
  • Accessibility: Uses aria-live="polite" on viewport sections, respects prefers-reduced-motion
  • Swipe-to-dismiss: Built-in pointer-event-based vertical swipe gesture (30px threshold)

Installation

npm install sileo

Sileo requires react and motion as peer dependencies.


Quick Setup

  1. Mount <Toaster /> once at your app's root layout.
  2. Fire toasts from anywhere by importing sileo.
import { sileo, Toaster } from "sileo";

export default function App() {
  return (
    <>
      <Toaster position="top-right" />
      <YourApp />
    </>
  );
}
Because sileo ships with "use client", it works seamlessly in Next.js App Router without extra wrappers.

Basic Usage

Sileo exposes a global controller sileo with state-specific shortcuts:

import { sileo } from "sileo";

// State shortcuts (each returns the toast `id` as a string)
sileo.success({ title: "Saved", description: "Your changes were stored." });
sileo.error({ title: "Failed", description: "Could not save." });
sileo.warning({ title: "Warning", description: "Disk space low." });
sileo.info({ title: "Tip", description: "Try the new feature." });

// Generic toast (defaults to success, but accepts `type` for dynamic state)
sileo.show({ title: "Done", type: "success" });

// Dynamic state selection
sileo.show({
  type: response.ok ? "success" : "error",
  title: "Upload complete",
});

All sileo Methods

MethodReturnsDescription
sileo.success(options)string (id)Green success toast
sileo.error(options)string (id)Red error toast
sileo.warning(options)string (id)Amber warning toast
sileo.info(options)string (id)Blue info toast
sileo.action(options)string (id)Toast with an action button
sileo.show(options)string (id)Generic toast. Uses options.type for state, defaults to "success"
sileo.promise(promise, opts)Promise<T>Loading -> success/error flow. Returns the original promise
sileo.dismiss(id)voidDismiss a specific toast by id
sileo.clear(position?)voidClear all toasts, or only those at a specific position

SileoOptions

Passed to every sileo.*() call.

PropTypeDefaultDescription
titlestring--Toast heading (displayed in the pill)
description`ReactNode \string`--Body content (shown when expanded). Accepts JSX for rich content
typeSileoState--Dynamic state for sileo.show(). One of `"success" \"loading" \"error" \"warning" \"info" \"action"`
positionSileoPositionToaster defaultOverride position for this individual toast
duration`number \null`6000Auto-dismiss in milliseconds. null = sticky (never auto-dismisses)
icon`ReactNode \null`State iconCustom icon replacing the default in the badge circle
fillstring"#FFFFFF"SVG fill color for the toast background shape
stylesSileoStyles--CSS class overrides for sub-elements
roundnessnumber16Border radius in pixels for the SVG shapes
autopilot`boolean \{expand?: number; collapse?: number}`trueAuto expand/collapse timing. false = hover only
buttonSileoButton--Action button configuration

Action Toast

Action toasts include a clickable button inside the expanded area:

sileo.action({
  title: "New version available",
  description: "Reload to update",
  button: {
    title: "Reload",
    onClick: () => window.location.reload(),
  },
});

SileoButton

interface SileoButton {
  title: string;
  onClick: () => void;
}

Promise Toast

sileo.promise chains loading -> success/error states from a single promise. It returns the original promise so you can chain further.

  • The first argument can be a Promise<T> or a function () => Promise<T> (useful for lazy execution).
  • success and error can be static options or callbacks that receive the resolved/rejected value.
  • The optional action field, when provided, replaces the success toast with an action-state toast.
type User = { name: string };

const result = await sileo.promise<User>(createUser(data), {
  loading: { title: "Creating account..." },
  success: (user) => ({
    title: `Welcome, ${user.name}!`,
  }),
  error: (err: any) => ({
    title: "Signup failed",
    description: err?.message ?? "Unknown error",
  }),
});
// `result` is the resolved User object

With lazy promise (function):

sileo.promise(() => fetch("/api/data").then((r) => r.json()), {
  loading: { title: "Fetching data..." },
  success: { title: "Data loaded" },
  error: { title: "Failed to load" },
});

With action replacing success:

sileo.promise<{ url: string }>(uploadFile(file), {
  loading: { title: "Uploading..." },
  success: { title: "Uploaded" }, // Ignored when `action` is present
  error: { title: "Upload failed" },
  action: (data) => ({
    title: "File ready",
    description: "Click to open",
    button: {
      title: "Open",
      onClick: () => window.open(data.url),
    },
  }),
});

SileoPromiseOptions<T>

interface SileoPromiseOptions<T = unknown> {
  loading: SileoOptions;
  success: SileoOptions | ((data: T) => SileoOptions);
  error: SileoOptions | ((err: unknown) => SileoOptions);
  action?: SileoOptions | ((data: T) => SileoOptions);
  position?: SileoPosition;
}

Positions

Six positions available. Set a default on <Toaster />, or override per toast:

type SileoPosition =
  | "top-left"
  | "top-center"
  | "top-right"     // default
  | "bottom-left"
  | "bottom-center"
  | "bottom-right";
<Toaster position="bottom-center" />

// Override for a specific toast
sileo.success({ title: "Saved", position: "top-left" });

The SILEO_POSITIONS constant array is also exported for iteration:

import { SILEO_POSITIONS } from "sileo"; // Not exported from index (internal)

Toaster (Viewport Component)

<Toaster /> is the viewport component that renders toasts. Add it once at your root layout.

import { Toaster } from "sileo";

Props

PropTypeDefaultDescription
childrenReactNode--App content to render alongside toasts
positionSileoPosition"top-right"Default position for all toasts
offset`number \string \{top?, right?, bottom?, left?}`--Distance from viewport edges
optionsPartial<SileoOptions>--Default options merged into every toast
theme`"light" \"dark" \"system"`--Automatic fill based on color scheme. "system" follows OS preference

Theme

The theme prop automatically sets the toast fill color based on the selected scheme, saving you from manually configuring dark/light fills:

  • "light" -> fill is #1a1a1a (dark toast on light backgrounds) + light description text
  • "dark" -> fill is #f2f2f2 (light toast on dark backgrounds) + dark description text
  • "system" -> Follows prefers-color-scheme media query, reactively updates on OS change
<Toaster position="top-right" theme="system" />

When theme is set, the viewport renders data-theme="light" or data-theme="dark" which CSS uses to auto-style description text opacity.

If you set both theme and fill on individual toasts, the per-toast fill takes precedence.

Offset

Accepts a number (px), a CSS string, or a per-side object:

<Toaster offset={20} />
<Toaster offset="1.5rem" />
<Toaster offset={{ top: 20, right: 16 }} />

Default Options (global)

<Toaster
  options={{
    fill: "#171717",
    styles: { description: "text-white/75!" },
  }}
/>

Every toast will inherit these defaults. Per-toast options override them. The styles object is shallow-merged (per-toast styles overlay global styles).


Styling

Sileo looks great out of the box. When customization is needed, there are several escape hatches.

Fill Color

fill sets the SVG background color of the toast shape. Default: "#FFFFFF".

For dark toasts, use a dark fill and pair it with light text via styles:

sileo.success({
  title: "Dark toast",
  fill: "#171717",
  styles: {
    title: "text-white!",
    description: "text-white/75!",
  },
});

Style Overrides (styles)

Override CSS classes on individual sub-elements. When using Tailwind, add ! for specificity.

SileoStyles

interface SileoStyles {
  title?: string;       // The heading text
  description?: string; // The body/description area
  badge?: string;       // The icon badge circle
  button?: string;      // The action button
}

Available Data-Attribute Selectors

KeyElementCSS Selector
titleHeading text[data-sileo-title]
descriptionBody/description area[data-sileo-description]
badgeIcon badge circle[data-sileo-badge]
buttonAction button[data-sileo-button]

Additional data-attributes available for CSS targeting:

SelectorDescription
[data-sileo-toast]The outermost toast element (a <button>)
[data-sileo-toast][data-state="success"]Toast filtered by state
[data-sileo-toast][data-expanded="true"]Expanded toast
[data-sileo-toast][data-exiting="true"]Toast in exit animation
[data-sileo-viewport]The fixed viewport <section>
[data-sileo-viewport][data-position="top-right"]Viewport filtered by position
[data-sileo-viewport][data-theme="dark"]Viewport with theme applied
[data-sileo-canvas]The SVG canvas wrapper
[data-sileo-svg]The inner SVG element
[data-sileo-pill]Animated collapsed pill rect
[data-sileo-body]Animated expanded body rect
[data-sileo-header]The header row container
[data-sileo-content]The expandable content area

Example: Full dark theme with Tailwind

sileo.success({
  title: "Custom styled",
  fill: "black",
  styles: {
    title: "text-white!",
    description: "text-white/75!",
    badge: "bg-white/20!",
    button: "bg-white/10!",
  },
});

Custom Icons

Pass any React node as icon to replace the default state icon:

sileo.info({
  title: "Custom icon",
  icon: <MyIcon />,
});

Pass icon: null to render no icon at all.

Default icons by state (Lucide-style SVG inlined):

  • success -> checkmark
  • error -> X
  • warning -> circle with exclamation
  • info -> life buoy
  • loading -> spinning circle (CSS animation)
  • action -> arrow right

Custom Description (JSX)

description accepts JSX, enabling rich content inside the expanded area:

sileo.info({
  title: "Rich content",
  description: (
    <div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
      <span>Multiple elements supported</span>
      <img src="/preview.png" alt="Preview" width={120} />
    </div>
  ),
});

Roundness

Control the border radius via roundness (default 16):

sileo.success({ title: "Sharp", roundness: 8 });   // Sharper corners
sileo.success({ title: "Pill", roundness: 24 });    // More pill-like
Performance: Higher roundness increases the SVG blur radius for the gooey morph effect (blur = roundness * 0.5), which is more expensive to render. The recommended value is 16.

Autopilot

By default, toasts auto-expand after ~150ms and collapse ~4 seconds before dismissing. Control this behavior:

// Disable entirely (hover to expand, click away to collapse)
sileo.info({ title: "Manual", autopilot: false });

// Custom timing (milliseconds)
sileo.info({
  title: "Custom timing",
  autopilot: { expand: 250, collapse: 300 },
});

Internal defaults (derived from DEFAULT_TOAST_DURATION of 6000ms):

  • AUTO_EXPAND_DELAY = 150ms (6000 * 0.025)
  • AUTO_COLLAPSE_DELAY = 4000ms (6000 - 2000)

When autopilot is false or duration is null/0, auto expand/collapse is disabled.

Dismiss / Clear

// Dismiss a specific toast
const id = sileo.success({ title: "Will dismiss" });
sileo.dismiss(id);

// Clear all toasts
sileo.clear();

// Clear only toasts at a specific position
sileo.clear("bottom-center");

Toasts can also be swiped vertically (30px threshold) to dismiss them. This is built-in pointer-event swipe gesture behavior.

Sticky Toasts

Set duration: null to prevent auto-dismissal. The toast stays until dismissed programmatically or swiped:

sileo.warning({
  title: "Requires attention",
  description: "This won't go away on its own.",
  duration: null,
});

Global Defaults (Consistent Dark Theme)

<Toaster
  position="top-right"
  options={{
    fill: "#171717",
    roundness: 16,
    styles: {
      title: "text-white!",
      description: "text-white/75!",
      badge: "bg-white/10!",
      button: "bg-white/10! hover:bg-white/15!",
    },
  }}
/>

CSS Variables

Sileo exposes CSS custom properties for global overrides. Override them in :root or any parent element:

:root {
  /* State colors (oklch format) */
  --sileo-state-success: oklch(0.723 0.219 142.136);
  --sileo-state-loading: oklch(0.556 0 0);
  --sileo-state-error: oklch(0.637 0.237 25.331);
  --sileo-state-warning: oklch(0.795 0.184 86.047);
  --sileo-state-info: oklch(0.685 0.169 237.323);
  --sileo-state-action: oklch(0.623 0.214 259.815);

  /* Dimensions */
  --sileo-width: 350px;
  --sileo-height: 40px;

  /* Animation */
  --sileo-duration: 600ms;
}

Example: custom brand success color:

:root {
  --sileo-state-success: oklch(0.7 0.2 200);
}

Internal CSS Variables (per-toast, set via inline styles)

These are computed per-toast and set as CSS custom properties on [data-sileo-toast]:

VariableDescription
--_hCurrent toast height (collapsed or expanded)
--_pwPill width
--_pxPill X offset
--_htHeader transform (translate + scale)
--_coContent opacity (0 or 1)

Internal Color Variables (per-state, set via CSS)

VariableDescription
--sileo-toneThe resolved state color for badge/title
--sileo-tone-bgThe state color at 20% opacity for badge background
--sileo-btn-colorButton text color (equals state color)
--sileo-btn-bgButton background (state color at 15%)
--sileo-btn-bg-hoverButton hover background (state color at 25%)

TypeScript Exports

All types are exported from "sileo":

import type {
  SileoButton,
  SileoOptions,
  SileoPosition,
  SileoState,
  SileoStyles,
} from "sileo";

// SileoState = "success" | "loading" | "error" | "warning" | "info" | "action"

The SileoPromiseOptions<T> type is also exported from the toast module.


Accessibility

  • The viewport uses <section> with aria-live="polite" so screen readers announce new toasts without interrupting the user.
  • The toast root element is a <button> for keyboard focusability.
  • Each SVG icon has a <title> element for screen reader labeling.
  • Sileo respects prefers-reduced-motion: reduce by disabling all animations and transitions when the OS preference is set.

Architecture (Internal Details)

Understanding Sileo's internals helps when debugging or deeply customizing:

  1. Global store: A module-level singleton (store) holds all active toasts and notifies React via a listener Set. The Toaster component subscribes to this store and re-renders when toasts change.
  2. Toast IDs: When no id is provided by the user, toasts use "sileo-default" as their id. This means calling sileo.success(...) repeatedly without an id will replace the previous toast (same-id update behavior). Provide a unique id for multiple simultaneous toasts of the same state.
  3. SVG Gooey Effect: Each toast renders an <svg> with:

- A <filter> containing feGaussianBlur (stdDeviation = roundness * 0.5) + feColorMatrix + feComposite - Two <motion.rect> elements (pill + body) animated via motion/react spring transitions - The gooey filter creates the organic blob-merging effect between pill and expanded card

  1. Spring Physics: Animations use motion/react's spring transition with bounce: 0.25 and computed duration (default 0.6s). CSS transitions use a linear() easing approximation of the same spring curve.
  2. Expand Direction: Toasts at top-* positions expand downward; toasts at bottom-* positions expand upward (via CSS scaleY(-1) transform on the canvas).
  3. Timer Management: Each Toaster instance manages auto-dismiss timers per toast. Hovering over any toast pauses all timers; leaving resumes them. This hover-pause behavior is Toaster-level, not per-toast.
  4. Header Morphing: When a toast's state changes (e.g., loading -> success via promise), the header performs a blur-based crossfade animation between the old and new state, using two stacked layers (current + prev).

Integration Checklist

  • Install sileo (and ensure motion peer dep is available)
  • Mount one <Toaster /> at the root layout
  • Use sileo.success/error/warning/info/show/action based on context
  • For async flows, prefer sileo.promise(...)
  • For theming, either use theme prop or manual fill + styles + CSS variables
  • For programmatic dismissal, use dismiss(id) or clear(...)
  • Provide unique id values when multiple toasts should coexist simultaneously

Common Patterns

Form submission feedback

const handleSubmit = async (data: FormData) => {
  await sileo.promise(saveForm(data), {
    loading: { title: "Saving..." },
    success: { title: "Form saved" },
    error: (err: any) => ({
      title: "Save failed",
      description: err?.message,
    }),
  });
};

Undo action toast

const id = sileo.action({
  title: "Item deleted",
  description: "This action can be undone",
  duration: 8000,
  button: {
    title: "Undo",
    onClick: () => {
      restoreItem(itemId);
      sileo.dismiss(id);
    },
  },
});

Multiple simultaneous toasts

// Use unique ids to prevent replacement
sileo.info({ title: "Downloading file 1...", id: "download-1", duration: null });
sileo.info({ title: "Downloading file 2...", id: "download-2", duration: null });

// Dismiss individually
sileo.dismiss("download-1");
sileo.dismiss("download-2");

平台分布

Codex

32.99%
按下载量换算107

Claude

31.62%
按下载量换算103

Cursor

19.28%
按下载量换算63

Gemini CLI

9.78%
按下载量换算32

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills