{"id":22194215,"url":"https://github.com/cgwebdev2003/toast-cg","last_synced_at":"2025-06-26T13:33:37.377Z","repository":{"id":212612507,"uuid":"731928781","full_name":"CGWebDev2003/toast-cg","owner":"CGWebDev2003","description":"A lightweight toast packege in JS and CSS","archived":false,"fork":false,"pushed_at":"2024-01-03T14:20:02.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T02:41:37.715Z","etag":null,"topics":["css","framework","html","javascript","js","library","modal","npm","package","toast"],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CGWebDev2003.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2023-12-15T08:07:52.000Z","updated_at":"2024-01-03T14:23:22.000Z","dependencies_parsed_at":"2023-12-15T08:20:30.894Z","dependency_job_id":"660e1a11-a587-4659-8358-389907b92bcb","html_url":"https://github.com/CGWebDev2003/toast-cg","commit_stats":null,"previous_names":["cgwebdev2003/toast-cg"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/CGWebDev2003/toast-cg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CGWebDev2003%2Ftoast-cg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CGWebDev2003%2Ftoast-cg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CGWebDev2003%2Ftoast-cg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CGWebDev2003%2Ftoast-cg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CGWebDev2003","download_url":"https://codeload.github.com/CGWebDev2003/toast-cg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CGWebDev2003%2Ftoast-cg/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262076818,"owners_count":23255075,"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":["css","framework","html","javascript","js","library","modal","npm","package","toast"],"created_at":"2024-12-02T13:11:59.311Z","updated_at":"2025-06-26T13:33:37.323Z","avatar_url":"https://github.com/CGWebDev2003.png","language":"CSS","readme":"# Toast Class Documentation\n\nThe `Toast` class facilitates the creation of customizable toast messages. These toasts can be easily integrated into web applications for displaying brief notifications. The documentation outlines the class structure, constructor parameters, usage examples, and key features.\n\n## Class: Toast\n\n### Description\n\nCreate a new toast with configurable options such as icon, message text, style, position, and visibility time.\n\n### Constructor\n\n```javascript\nconst myToast = new Toast({\n\ticon: \"YOUR ICON\",\n\ttext: \"Test Toast\",\n\tstyle: \"primary\",\n\tposition: \"top-right\",\n\ttime: 5000,\n});\n```\n\n#### Parameters\n\n-   `config` (Object): An object containing the configuration options for the toast.\n\n    -   `parent` (String): (Optional) The class or id of the target element. If `null`, the toast will be appended to `document.body`.\n\n    -   `icon` (String): (Optional) The HTML or text content for the toast icon.\n\n    -   `text` (String): (Required) The message text to be displayed in the toast.\n\n    -   `style` (String): (Optional) The style of the toast, which can be one of the following: \"primary\", \"accent\", \"information\", \"success\", \"warning\", or \"error\".\n\n    -   `position` (String): (Optional) The position of the toast on the screen, which can be one of the following: \"left-top\", \"left-bottom\", \"right-top\", or \"right-bottom\".\n\n    -   `time` (Number): (Optional) The time (in milliseconds) until the toast becomes invisible. If not provided, the toast will remain visible until manually removed.\n\n### Example\n\n```javascript\nconst myToast = new Toast({\n\ticon: \"YOUR ICON\",\n\ttext: \"Test Toast\",\n\tstyle: \"primary\",\n\tposition: \"top-right\",\n\ttime: 5000,\n});\n```\n\nThis example creates a new `Toast` instance with a specified icon, message text, style, position, and visibility time.\n\n### Toast Configuration\n\n-   Icon: If an icon is provided, it will be displayed on the left side of the toast.\n\n-   Message Text: The main content of the toast, displaying the message provided in the configuration.\n\n-   Style: The style of the toast determines its appearance. Options include \"primary\", \"accent\", \"information\", \"success\", \"warning\", or \"error\".\n\n-   Position: The position of the toast on the screen. Options include \"left-top\", \"left-bottom\", \"right-top\", or \"right-bottom\".\n\n-   Time: The time until the toast becomes invisible. If not provided, the toast will remain visible until manually removed.\n\n### Error Handling\n\nIf the `text` parameter is not provided, an error message will be logged to the console, indicating that a message should be added to the toast.\n\n### Usage\n\nTo use the `Toast` class, instantiate it with a configuration object, specifying the desired icon, message text, style, position, and visibility time. The toast will then be appended to the specified parent element or `document.body` if no parent is provided. If a visibility time is specified, the toast will automatically be removed after that duration.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgwebdev2003%2Ftoast-cg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgwebdev2003%2Ftoast-cg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgwebdev2003%2Ftoast-cg/lists"}