{"id":22706192,"url":"https://github.com/hichamecode/hichamebelyazid-modal","last_synced_at":"2026-01-28T16:38:50.391Z","repository":{"id":263129432,"uuid":"889418133","full_name":"hichamecode/hichamebelyazid-modal","owner":"hichamecode","description":"A lightweight React lib to handle modals","archived":false,"fork":false,"pushed_at":"2024-11-17T17:04:55.000Z","size":194,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T12:52:25.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/hichamecode.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-11-16T10:29:55.000Z","updated_at":"2024-11-17T20:18:12.000Z","dependencies_parsed_at":"2024-11-16T12:26:54.952Z","dependency_job_id":"114b29d0-f91b-4029-87ca-a572d9f881ee","html_url":"https://github.com/hichamecode/hichamebelyazid-modal","commit_stats":null,"previous_names":["hichamecode/hichamebelyazid-modal"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hichamecode/hichamebelyazid-modal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hichamecode%2Fhichamebelyazid-modal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hichamecode%2Fhichamebelyazid-modal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hichamecode%2Fhichamebelyazid-modal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hichamecode%2Fhichamebelyazid-modal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hichamecode","download_url":"https://codeload.github.com/hichamecode/hichamebelyazid-modal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hichamecode%2Fhichamebelyazid-modal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28847020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-12-10T10:07:56.812Z","updated_at":"2026-01-28T16:38:50.364Z","avatar_url":"https://github.com/hichamecode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  **hichamebelyazid-modal**\n---\n## Introduction\n---\nThis project provides a _simple_ and _lightweight_ solution for handling your modals in React\n## Table of Contents\n---\n1. [Introduction](#introduction)\n3. [Installation](#installation)\n4. [Usage](#usage)\n5. [Examples](#examples)\n6. [License](#license)\n7. [Author](#author)\n8. [Keywords](#keywords)\n\n##  Installation\n---\nTo install the package using NPM:\n- type the code below\nOR\n- copy \u0026 paste it\n\n_note_: my name is tricky :sweat_smile: beware of typos!\n\n```bash\nnpm  install  hichamebelyazid-modal\n```\nI recommand using the Roboto Font as it is free. Also, it aligns perfectly with the Material Design principles.\n\nTo do so, please embed this code in the `\u003chead\u003e` of your html file\n\n```bash\n\u003clink rel=\"preconnect\"  href=\"https://fonts.googleapis.com\"\u003e\n\u003clink rel=\"preconnect\"  href=\"https://fonts.gstatic.com\"  crossorigin\u003e\n\u003clink href=\"https://fonts.googleapis.com/css2?family=Genos:ital,wght@0,100..900;1,100..900\u0026family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900\u0026display=swap\"  rel=\"stylesheet\"\u003e\n```\n\n## Usage\n---\nAfter the installation, you can start by importing the Modal component and the ClosingButton component, each with their own CSS styles. \n\n- **Imports**\n```bash \n// components\nimport { Modal } from 'hichamebelyazid-modal';\nimport { ClosingButton } from 'hichamebelyazid-modal';\n// styles\nimport  \"./Modal.css\";\nimport  './ClosingButton.css';\n```\n- **Props**\n\nThe `Modal` component expects the following props:\n\n-    **`modalTitle`** (`string`): The title displayed at the top of the modal.\n\n-   **`modalText`** (`string`): The text content that appears inside the modal.\n\n-   **`onClose`** (`function`): A function that closes the modal.\n\nThe `ClosingButton` component expects the following props:\n\n-   **`onClick`** (`function`): A function that will close the modal.\n-   **`closingButtonText`** (`string`): The text to be displayed on the button.\n\n-  **Accessibility**\n\n  The modal has the `role=\"dialog\"` and `aria-modal=\"true\"` attributes for screen reader accessibility.\n Users can close the modal by pressing the **Escape** or **Enter** key, which is handled by the `handleKeyDown` function.\n\n## Examples\n---\n```bash\nimport { useState } from 'react';\nimport Modal from './components/Modal/Modal';\nimport './App.css';\n\nfunction App() {\n  const [isModalOpen, setIsModalOpen] = useState(false);\n\n  const handleOpenModal = () =\u003e setIsModalOpen(true);\n  const handleCloseModal = () =\u003e setIsModalOpen(false);\n\n  return (\n    \u003cdiv\u003e\n      \u003cbutton className='test-button' onClick={handleOpenModal}\u003eCLICK TO TEST THE MODAL\u003c/button\u003e\n      {isModalOpen \u0026\u0026 (\n        \u003cModal\n          modalTitle=\"EMPLOYEE CREATED\"\n          modalText=\"you can now access the employee in the list\"\n          onClose={handleCloseModal}\n        /\u003e\n      )}\n    \u003c/div\u003e\n  );\n}\n\nexport default App;\n```\n\n## License\n---\nThis project is licensed under the [MIT License](https://opensource.org/licenses/MIT).  \nFeel free to use it and contribute to this library.\n\n## Author\n---\n- **Hichame Belyazid** ([GitHub Profile](https://github.com/hichamecode/))\n\n## Keywords\n---\n**react** - **react-component** - **modal** - **dialog** - **lightweigt** - **simple**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhichamecode%2Fhichamebelyazid-modal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhichamecode%2Fhichamebelyazid-modal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhichamecode%2Fhichamebelyazid-modal/lists"}