{"id":23189309,"url":"https://github.com/oom-components/horizontal-menu","last_synced_at":"2025-10-25T10:31:51.596Z","repository":{"id":268230132,"uuid":"903721072","full_name":"oom-components/horizontal-menu","owner":"oom-components","description":"Web component to create a responsive horizontal menu","archived":false,"fork":false,"pushed_at":"2024-12-15T12:03:07.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T03:15:04.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://oom-components.github.io/horizontal-menu/demo","language":"JavaScript","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/oom-components.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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-12-15T11:47:40.000Z","updated_at":"2025-01-13T18:10:10.000Z","dependencies_parsed_at":"2024-12-15T12:28:45.996Z","dependency_job_id":"78569649-d3c1-4de6-a39e-7faf08eaa916","html_url":"https://github.com/oom-components/horizontal-menu","commit_stats":null,"previous_names":["oom-components/horizontal-menu","oscarotero/horizontal-menu"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oom-components%2Fhorizontal-menu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oom-components%2Fhorizontal-menu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oom-components%2Fhorizontal-menu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oom-components%2Fhorizontal-menu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oom-components","download_url":"https://codeload.github.com/oom-components/horizontal-menu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238125154,"owners_count":19420458,"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":[],"created_at":"2024-12-18T11:17:58.732Z","updated_at":"2025-10-25T10:31:51.591Z","avatar_url":"https://github.com/oom-components.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Horizontal menu\n\nWeb component to create a responsive horizontal menu. In narrow screens, the\nitems that don't fit in the menu are moved to a dropdown list.\n\n- No dependencies\n- Very light\n- Follow the **progressive enhancement strategy**. If the JavaScript fails, the\n  links are still visible.\n- No styles or themes are provided with this package. Just the basic styles.\n- Build with modern javascript, using ES6 modules and custom elements\n\n## Usage\n\nImport and register the component with the desired tag name:\n\n```js\nimport Menu from \"horizontal-menu/horizontal-menu.js\";\n\ncustomElements.define(\"oom-menu\", Menu);\n```\n\nCreate the menu with the following HTML code:\n\n```html\n\u003coom-menu\u003e\n  \u003ca href=\"#1\"\u003eLink 1\u003c/a\u003e\n  \u003ca href=\"#2\"\u003eLink 2\u003c/a\u003e\n  \u003ca href=\"#3\"\u003eLink 3\u003c/a\u003e\n  \u003ca href=\"#4\"\u003eLink 4\u003c/a\u003e\n  \u003ca href=\"#5\"\u003eLink 5\u003c/a\u003e\n\u003c/oom-menu\u003e\n```\n\nUse CSS to customize your menu. This web component uses a shadow dom and _parts_\nto customize the internal elements.\n\n```css\nmy-menu {\n  /* Generic styles */\n  display: flex;\n\n  a {\n    white-space: nowrap;\n  }\n\n  \u0026::part(menu) {\n    /* Main container */\n  }\n  \u0026::part(links) {\n    /* Horizontal links */\n  }\n  \u0026::part(dropdown) {\n    /* Dropdown container */\n  }\n  \u0026::part(dropdown-button) {\n    /* Button to show/hide the dropdown */\n  }\n  \u0026::part(dropdown-links) {\n    /* Dropdown links */\n  }\n}\n```\n\nThe HTML structure of the shadow DOM is:\n\n```html\n\u003cdiv part=\"menu\"\u003e\n  \u003cdiv part=\"links\"\u003e\n    \u003c!-- Horizontal links --\u003e\n  \u003c/div\u003e\n  \u003cdiv part=\"dropdown\"\u003e\n    \u003cbutton part=\"dropdown-button\"\u003e\n      \u003c!-- Button to show/hide the hidden links --\u003e\n    \u003c/button\u003e\n    \u003cdiv part=\"dropdown-links\"\u003e\n      \u003c!-- Hidden links --\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foom-components%2Fhorizontal-menu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foom-components%2Fhorizontal-menu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foom-components%2Fhorizontal-menu/lists"}