{"id":26462985,"url":"https://github.com/elliott-chong/aero-nudge","last_synced_at":"2025-03-19T06:39:06.447Z","repository":{"id":250430935,"uuid":"834457770","full_name":"Elliott-Chong/aero-nudge","owner":"Elliott-Chong","description":"Clerk inspired floating toast button for confirmation of actions, powered by Sonner","archived":false,"fork":false,"pushed_at":"2024-07-30T10:08:49.000Z","size":110,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T17:33:28.462Z","etag":null,"topics":["clerk","react","sonner","toast","toast-message","toast-notifications"],"latest_commit_sha":null,"homepage":"https://aero-nudge.netlify.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Elliott-Chong.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-27T10:25:29.000Z","updated_at":"2024-12-01T05:42:03.000Z","dependencies_parsed_at":"2024-07-27T11:51:44.211Z","dependency_job_id":null,"html_url":"https://github.com/Elliott-Chong/aero-nudge","commit_stats":null,"previous_names":["elliott-chong/aero-nudge"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elliott-Chong%2Faero-nudge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elliott-Chong%2Faero-nudge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elliott-Chong%2Faero-nudge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elliott-Chong%2Faero-nudge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Elliott-Chong","download_url":"https://codeload.github.com/Elliott-Chong/aero-nudge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244374609,"owners_count":20442665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clerk","react","sonner","toast","toast-message","toast-notifications"],"created_at":"2025-03-19T06:39:05.968Z","updated_at":"2025-03-19T06:39:06.437Z","avatar_url":"https://github.com/Elliott-Chong.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"https://github.com/user-attachments/assets/e08b7922-b931-445c-b1f3-f826cb2215c7\n\n\n\u003cimg width=\"1149\" alt=\"image\" src=\"https://github.com/user-attachments/assets/ad2cac38-f07a-46cc-91ed-fd7e47ec1d6d\"\u003e\n\n\n\n# aero-nudge\n\nClerk inspired floating toast button for confirmation of actions, powered by Sonner.\n\n## Installation\n\n```bash\nnpm install aero-nudge\n# or\nyarn add aero-nudge\n# or\npnpm add aero-nudge\n```\n\n## Pre-requisites\n\nPlease make sure to install sonner and import the Toaster component into your root layout first! More instructions [here](https://github.com/emilkowalski/sonner)\n\n```typescript\nimport { Toaster, toast } from 'sonner';\n\n// ...\n\nfunction App() {\n  return (\n    \u003cdiv\u003e\n      \u003cToaster /\u003e\n      \u003cbutton onClick={() =\u003e toast('My first toast')}\u003eGive me a toast\u003c/button\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n\n## Usage\n\n```typescript\nimport useActionToast from 'aero-nudge';\n\nconst MyComponent = () =\u003e {\n  const handleAction = async () =\u003e {\n    // Your action logic here\n  };\n\n  const handleReset = () =\u003e {\n    // Your reset logic here\n  };\n\n  useActionToast({\n    onAction: handleAction,\n    onReset: handleReset,\n    isLoading: false,\n    show: true,\n    description: 'Optional description'\n  });\n\n  return (\n    // Your component JSX\n  );\n};\n```\n\n## API\n\n### `useActionToast` Hook\n\nThis hook creates a floating toast button for confirming actions.\n\n#### Props\n\n- `onAction`: `() =\u003e Promise\u003cvoid\u003e` - Function to call when the \"Save\" button is clicked.\n- `onReset`: `() =\u003e void` - (Optional) Function to call when the \"Reset\" button is clicked.\n- `isLoading`: `boolean` - Whether the action is in progress.\n- `show`: `boolean` - Whether to show the toast.\n- `description`: `string` - (Optional) Additional description to show in the toast.\n\n## Features\n\n- Clerk-inspired design\n- Powered by Sonner for toast notifications\n- Customizable action and reset buttons\n- Loading state support\n- Optional description text\n\n## Dependencies\n\n- React\n- sonner\n\n## License\n\nMIT\n\n## Author\n\nElliott Chong\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliott-chong%2Faero-nudge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliott-chong%2Faero-nudge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliott-chong%2Faero-nudge/lists"}