[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F7NZBQVRPX2KHBK2FEKVGQ":3,"skill-same:01M7F7NZBQVRPX2KHBK2FEKVGQ":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7F7NZBQVRPX2KHBK2FEKVGQ","ask-sonner",null,"Guide to Sonner, the React toast library — install and wire up the Toaster, pick the right toast() call, promise and loading toasts, updating, dismissing and persisting toasts, styling, theming and icons, positioning and multiple toasters. Use when working with Sonner or troubleshooting it — toasts that don't appear, appear twice, lose their styles, ignore Tailwind classes, sit behind a modal, or don't follow dark mode.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fask-sonner\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: ask-sonner\ndescription: Guide to Sonner, the React toast library — install and wire up the Toaster, pick the right toast() call, promise and loading toasts, updating, dismissing and persisting toasts, styling, theming and icons, positioning and multiple toasters. Use when working with Sonner or troubleshooting it — toasts that don't appear, appear twice, lose their styles, ignore Tailwind classes, sit behind a modal, or don't follow dark mode.\n---\n\n# Working With Sonner\n\nA guide skill for [Sonner](https:\u002F\u002Fsonner.emilkowal.ski), the toast library. When a task involves Sonner — wiring it up, rendering toasts, styling them, or fixing them — answer from this file first. Full prop tables for `\u003CToaster \u002F>` and `toast()` live in [API.md](API.md); read it when you need an exact prop name, type, or default.\n\n## Setup\n\nTwo pieces, and only two:\n\n1. **One `\u003CToaster \u002F>`, mounted once**, as close to the root as possible (in Next.js: `layout.tsx` — it works inside server components). Never render it per-page or conditionally; a second mounted Toaster duplicates every toast.\n2. **`toast()` called from client code** — event handlers, effects, callbacks. It's a plain function, no hook or provider needed, but it does nothing on the server: in a server action, return the result and call `toast()` in the client code that receives it.\n\n```jsx\nimport { Toaster } from 'sonner'; \u002F\u002F once, in layout\nimport { toast } from 'sonner';   \u002F\u002F anywhere client-side\n```\n\n## Picking the right call\n\n| You want | Call |\n| --- | --- |\n| Plain message | `toast('Title')` — add `{ description }` for a second line |\n| Success \u002F error \u002F info \u002F warning icon | `toast.success('…')`, `toast.error('…')`, etc. |\n| Spinner while you manage state yourself | `toast.loading('…')`, then update it by id |\n| Loading → success\u002Ferror tied to a promise | `toast.promise(promise, { loading, success, error })` — success\u002Ferror accept functions receiving the resolved value\u002Ferror |\n| Button that does something | `{ action: { label, onClick } }` — closes the toast unless `onClick` calls `event.preventDefault()`; `cancel` is the secondary variant |\n| Custom JSX, default toast shell | `toast(\u003Cjsx \u002F>)` |\n| Custom JSX, no styles at all | `toast.custom((t) => \u003Cjsx \u002F>)` — headless, `t` gives you the id to dismiss |\n\n## Recipes\n\n**Update a toast** — call `toast()` again with the same `id`; only the props you pass change. Switching to `toast.success(…, { id })` changes the type. This is how loading → success flows work without `toast.promise`:\n\n```jsx\nconst id = toast.loading('Uploading…');\ntoast.success('Uploaded', { id });\n```\n\n**Persist** — `{ duration: Infinity }`. **Dismiss** — `toast.dismiss(id)`, or `toast.dismiss()` for all. **Read active toasts** — `useSonner()` in React, `toast.getActiveToasts()` outside it.\n\n**Links or components in the text** — pass a function for the title or description: `toast(() => \u003Ca href=\"…\">View\u003C\u002Fa>)`.\n\n**Multiple toasters** — give each an `id` and target with `toast('…', { toasterId: 'canvas' })`. Without `toasterId`, every toaster renders the toast.\n\n**Close callbacks** — `onDismiss` fires on close button or swipe; `onAutoClose` fires on timeout. They are separate; there is no single \"closed\" callback.\n\n## Styling — the escalation ladder\n\nClimb only as far as the change requires; jumping to the top rung too early is fine (it's the recommended end state), lingering in the middle is not.\n\n1. **Defaults** — plus `richColors` on the Toaster for colorful success\u002Ferror, `invert` to flip against the theme.\n2. **Inline tweaks** — `toastOptions={{ style: {…} }}` on the Toaster for all toasts, or `style` per `toast()` call.\n3. **Classes on parts** — `toastOptions={{ classNames: { toast, title, description, actionButton, cancelButton, closeButton } }}`. Sonner's injected styles win the cascade, so every class needs `!important` (Tailwind: `!text-red-900`). If you're marking more than a few things important, stop — go headless.\n4. **Headless** — `toast.custom()` with your own JSX, keeping Sonner's positioning, stacking, and swipe. The recommended approach for a design-system toast: wrap it in your own `toast()` abstraction. (`unstyled: true` exists as a halfway house, but headless gives more control for the same effort.)\n\n**Icons** — swap defaults per-type with the Toaster's `icons` prop, per-toast with `icon`, remove with `null`.\n\n**Theme** — `theme` defaults to `'light'` and does not track the OS. Pass `theme=\"system\"`, or wire your theme provider: `\u003CToaster theme={resolvedTheme} \u002F>` from `next-themes`.\n\n## Troubleshooting\n\n| Symptom | Cause → fix |\n| --- | --- |\n| Toast never appears | No `\u003CToaster \u002F>` mounted, or it unmounted (conditional render, per-page placement). Mount one at the root. If calling from a server action: `toast()` is client-only — call it with the action's result on the client. |\n| Same toast appears twice | Two Toasters mounted (layout **and** page) — keep one. Or `toast()` fired in an effect under React StrictMode's dev double-invoke — fire from the event handler instead, or pass a stable `id` so the second call updates rather than duplicates. |\n| Tailwind\u002FCSS classes have no effect | Default styles override them. Mark them `!important`, or use `unstyled` \u002F headless (see the ladder above). |\n| Toasts render completely unstyled (common in Astro, view transitions) | Sonner's injected stylesheet was lost — import it explicitly in a layout: `import 'sonner\u002Fdist\u002Fstyles.css'`. |\n| Unstyled inside Shadow DOM | Styles land in `document.head`, not the shadow root. Copy the style tag whose text includes `[data-sonner-toaster]` into the shadow root. |\n| Toast behind a modal\u002Foverlay, or clipped | An ancestor creates a stacking context (`transform`, `filter`, `overflow`) or the overlay out-z-indexes the toaster. Move `\u003CToaster \u002F>` to the document root, outside any dialog\u002Fportal container. |\n| Dark mode ignored | `theme` defaults to `'light'` — set `theme=\"system\"` or pass the resolved theme (see Theme above). |\n| Success\u002Ferror look gray, not green\u002Fred | That's the default. Add `richColors` to the Toaster. |\n| Toast never closes | `duration: Infinity`, `dismissible: false`, or a `toast.promise` whose promise never settles — the loading toast waits forever. |\n| `toast.promise` stuck on loading | It needs a promise (or a function returning one) as its first argument, and the promise must actually resolve\u002Freject. |\n| Swipe-to-dismiss goes the wrong way \u002F doesn't work | Directions derive from `position`. Override with `swipeDirections` on the Toaster. |\n| Toast shows up in every toaster | Multiple toasters need targeting: give each Toaster an `id` and pass `toasterId` in the `toast()` call. |\n| Toasts too close to the screen edge on mobile | `offset` (desktop, default 32px) and `mobileOffset` (\u003C600px, default 16px) — numbers, CSS strings, or per-side objects. |\n","# Working With Sonner\n\nA guide skill for [Sonner](https:\u002F\u002Fsonner.emilkowal.ski), the toast library. When a task involves Sonner — wiring it up, rendering toasts, styling them, or fixing them — answer from this file first. Full prop tables for `\u003CToaster \u002F>` and `toast()` live in [API.md](API.md); read it when you need an exact prop name, type, or default.\n\n## Setup\n\nTwo pieces, and only two:\n\n1. **One `\u003CToaster \u002F>`, mounted once**, as close to the root as possible (in Next.js: `layout.tsx` — it works inside server components). Never render it per-page or conditionally; a second mounted Toaster duplicates every toast.\n2. **`toast()` called from client code** — event handlers, effects, callbacks. It's a plain function, no hook or provider needed, but it does nothing on the server: in a server action, return the result and call `toast()` in the client code that receives it.\n\n```jsx\nimport { Toaster } from 'sonner'; \u002F\u002F once, in layout\nimport { toast } from 'sonner';   \u002F\u002F anywhere client-side\n```\n\n## Picking the right call\n\n| You want | Call |\n| --- | --- |\n| Plain message | `toast('Title')` — add `{ description }` for a second line |\n| Success \u002F error \u002F info \u002F warning icon | `toast.success('…')`, `toast.error('…')`, etc. |\n| Spinner while you manage state yourself | `toast.loading('…')`, then update it by id |\n| Loading → success\u002Ferror tied to a promise | `toast.promise(promise, { loading, success, error })` — success\u002Ferror accept functions receiving the resolved value\u002Ferror |\n| Button that does something | `{ action: { label, onClick } }` — closes the toast unless `onClick` calls `event.preventDefault()`; `cancel` is the secondary variant |\n| Custom JSX, default toast shell | `toast(\u003Cjsx \u002F>)` |\n| Custom JSX, no styles at all | `toast.custom((t) => \u003Cjsx \u002F>)` — headless, `t` gives you the id to dismiss |\n\n## Recipes\n\n**Update a toast** — call `toast()` again with the same `id`; only the props you pass change. Switching to `toast.success(…, { id })` changes the type. This is how loading → success flows work without `toast.promise`:\n\n```jsx\nconst id = toast.loading('Uploading…');\ntoast.success('Uploaded', { id });\n```\n\n**Persist** — `{ duration: Infinity }`. **Dismiss** — `toast.dismiss(id)`, or `toast.dismiss()` for all. **Read active toasts** — `useSonner()` in React, `toast.getActiveToasts()` outside it.\n\n**Links or components in the text** — pass a function for the title or description: `toast(() => \u003Ca href=\"…\">View\u003C\u002Fa>)`.\n\n**Multiple toasters** — give each an `id` and target with `toast('…', { toasterId: 'canvas' })`. Without `toasterId`, every toaster renders the toast.\n\n**Close callbacks** — `onDismiss` fires on close button or swipe; `onAutoClose` fires on timeout. They are separate; there is no single \"closed\" callback.\n\n## Styling — the escalation ladder\n\nClimb only as far as the change requires; jumping to the top rung too early is fine (it's the recommended end state), lingering in the middle is not.\n\n1. **Defaults** — plus `richColors` on the Toaster for colorful success\u002Ferror, `invert` to flip against the theme.\n2. **Inline tweaks** — `toastOptions={{ style: {…} }}` on the Toaster for all toasts, or `style` per `toast()` call.\n3. **Classes on parts** — `toastOptions={{ classNames: { toast, title, description, actionButton, cancelButton, closeButton } }}`. Sonner's injected styles win the cascade, so every class needs `!important` (Tailwind: `!text-red-900`). If you're marking more than a few things important, stop — go headless.\n4. **Headless** — `toast.custom()` with your own JSX, keeping Sonner's positioning, stacking, and swipe. The recommended approach for a design-system toast: wrap it in your own `toast()` abstraction. (`unstyled: true` exists as a halfway house, but headless gives more control for the same effort.)\n\n**Icons** — swap defaults per-type with the Toaster's `icons` prop, per-toast with `icon`, remove with `null`.\n\n**Theme** — `theme` defaults to `'light'` and does not track the OS. Pass `theme=\"system\"`, or wire your theme provider: `\u003CToaster theme={resolvedTheme} \u002F>` from `next-themes`.\n\n## Troubleshooting\n\n| Symptom | Cause → fix |\n| --- | --- |\n| Toast never appears | No `\u003CToaster \u002F>` mounted, or it unmounted (conditional render, per-page placement). Mount one at the root. If calling from a server action: `toast()` is client-only — call it with the action's result on the client. |\n| Same toast appears twice | Two Toasters mounted (layout **and** page) — keep one. Or `toast()` fired in an effect under React StrictMode's dev double-invoke — fire from the event handler instead, or pass a stable `id` so the second call updates rather than duplicates. |\n| Tailwind\u002FCSS classes have no effect | Default styles override them. Mark them `!important`, or use `unstyled` \u002F headless (see the ladder above). |\n| Toasts render completely unstyled (common in Astro, view transitions) | Sonner's injected stylesheet was lost — import it explicitly in a layout: `import 'sonner\u002Fdist\u002Fstyles.css'`. |\n| Unstyled inside Shadow DOM | Styles land in `document.head`, not the shadow root. Copy the style tag whose text includes `[data-sonner-toaster]` into the shadow root. |\n| Toast behind a modal\u002Foverlay, or clipped | An ancestor creates a stacking context (`transform`, `filter`, `overflow`) or the overlay out-z-indexes the toaster. Move `\u003CToaster \u002F>` to the document root, outside any dialog\u002Fportal container. |\n| Dark mode ignored | `theme` defaults to `'light'` — set `theme=\"system\"` or pass the resolved theme (see Theme above). |\n| Success\u002Ferror look gray, not green\u002Fred | That's the default. Add `richColors` to the Toaster. |\n| Toast never closes | `duration: Infinity`, `dismissible: false`, or a `toast.promise` whose promise never settles — the loading toast waits forever. |\n| `toast.promise` stuck on loading | It needs a promise (or a function returning one) as its first argument, and the promise must actually resolve\u002Freject. |\n| Swipe-to-dismiss goes the wrong way \u002F doesn't work | Directions derive from `position`. Override with `swipeDirections` on the Toaster. |\n| Toast shows up in every toaster | Multiple toasters need targeting: give each Toaster an `id` and pass `toasterId` in the `toast()` call. |\n| Toasts too close to the screen edge on mobile | `offset` (desktop, default 32px) and `mobileOffset` (\u003C600px, default 16px) — numbers, CSS strings, or per-side objects. |\n",{"name":5,"description":7},"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","06-前端与设计\u002Fask-sonner",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill ask-sonner",{"tool":38,"command":39},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill ask-sonner",{"tool":41,"command":42},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill ask-sonner","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fask-sonner\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"API.md","REFERENCE","参考文档",4545,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fask-sonner\u002FAPI.md",[53,60,65,72,79,86],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":61,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]