{"id":15067483,"url":"https://github.com/jurajkavka/vue-hamburger-button","last_synced_at":"2026-01-03T12:04:18.570Z","repository":{"id":36942337,"uuid":"232300704","full_name":"JurajKavka/vue-hamburger-button","owner":"JurajKavka","description":"Hamburger button for the Vue apps.","archived":false,"fork":false,"pushed_at":"2023-01-05T05:00:46.000Z","size":4997,"stargazers_count":0,"open_issues_count":28,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T21:36:51.167Z","etag":null,"topics":["hamburger-button","vue","vuejs2"],"latest_commit_sha":null,"homepage":"","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/JurajKavka.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}},"created_at":"2020-01-07T10:29:04.000Z","updated_at":"2020-06-20T13:13:45.000Z","dependencies_parsed_at":"2023-01-17T07:30:37.426Z","dependency_job_id":null,"html_url":"https://github.com/JurajKavka/vue-hamburger-button","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JurajKavka%2Fvue-hamburger-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JurajKavka%2Fvue-hamburger-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JurajKavka%2Fvue-hamburger-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JurajKavka%2Fvue-hamburger-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JurajKavka","download_url":"https://codeload.github.com/JurajKavka/vue-hamburger-button/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243838164,"owners_count":20355989,"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":["hamburger-button","vue","vuejs2"],"created_at":"2024-09-25T01:24:22.419Z","updated_at":"2026-01-03T12:04:18.564Z","avatar_url":"https://github.com/JurajKavka.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :hamburger: vue-hamburger-button :hamburger:\nYes, it is just the [hamburger button](https://en.wikipedia.org/wiki/Hamburger_button), taken from W3C article [How TO - Menu Icon](https://www.w3schools.com/howto/howto_css_menu_icon.asp). This is its animated version.\n\n## Preview\nIf You want to see button in action, check the mentioned W3C tutorial, or install this project locally. It's as simple as to run these commands:\n\n```\ngit clone https://github.com/JurajKavka/vue-hamburger-button.git\n``` \n```\ncd vue-hamburger-button\n```\n```\nnpm install\n```\n\n```\nnpm run serve\n```\n\nThere are another commands for developers (please, inspect [package.json](package.json) too):\n```\nnpm run lint\nnpm run test\nnpm run build\n```\n\n## Installation and usage\nYou can install this component from [npm](https://www.npmjs.com/) with `npm` or `yarn`.\n```\nnpm install @jurajkavka/vue-hamburger-button\n```\nor\n```\nyarn add @jurajkavka/vue-hamburger-button\n```\n\n### Example app\nThis is very simple example of using `HamburgerButton`. Please, inspect the source code of the component and styles, to see its `props`, how to styles are composed and how they can be customized.\n\n\u003e **NOTE**: Even the `default-theme` has to be imported manually.\n\n```html\n\u003ctemplate\u003e\n  \u003cdiv id=\"app\"\u003e\n    \u003cHamburgerButton\n      :is-hamburger=\"true\"\n      theme=\"my-custom-theme\"\n      @click=\"onClick($event)\"\n    /\u003e\n    {{ isHamburger ? 'Hamburger' : 'Cross' }}\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport HamburgerButton from 'vue-hamburger-button'\n\nexport default {\n  name: 'app',\n  components: {\n    HamburgerButton\n  },\n  data () {\n    return {\n      isHamburger: true\n    }\n  },\n  methods: {\n    onClick(isInHamburgerState){\n      this.isHamburger = isInHamburgerState\n    }\n  }\n}\n\u003c/script\u003e\n\n\u003cstyle lang=\"scss\"\u003e\n/* Styles (themes) are not bundled within component itself. They must be specified \nmanually, even the 'default-theme', which is part of npm package. */\n@import 'vue-hamburger-button/src/scss/default-theme.scss';\n\n/* This example of customization extends default-theme. You can also copy whole\ndefault-theme to new file and customize size of the button, thickness of the bars etc. */\n.my-custom-theme {\n  @extend .default-theme;\n\n  .bar1, .bar2, .bar3 {\n    background-color: red;\n  }\n}\n\u003c/style\u003e\n```\n\n### Component props\n  - `isHamburger`: `true`, if initial state of the button is *hamburger*, or `false` if the initial state is *cross*. Default is `true`.\n  - `theme`: Name of the *root* class of your customized style. Default value is `default-theme`.\n  \n  \n### Component events\n  - `onClick(isInHamburgerState)`: event on mouse click, with argument, if the button is in *hamburger* or in *cross* state.\n  \n### Component customization\nSee the example app how to customize styles, but basically, it is about to have one *root* class, that will be passed to `theme` parameter of component. For example, you can copy whole [src/scss/default-theme.scss](src/scss/default-theme.scss) to a new file, rename *root* class `.default-theme` and make needed customization there. But **do not** change the names of the subclasses!\nFor another example, check [src/scss/big-red-hamburger.scss](/src/scss/big-red-hamburger.scss) file.\n\n\u003e **NOTE:** If You change *height* (thickness) of the bars, animation will not play very well. You will need to customize `translate` attribute of the `transform` property. I don't have exact recepie, how to set those values. I'm doing it just simple with *try and error* method and it works well.\n\n\n## TODO\n  - technically this is a clickable `div` and no `button`.  I'm not very happy with it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjurajkavka%2Fvue-hamburger-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjurajkavka%2Fvue-hamburger-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjurajkavka%2Fvue-hamburger-button/lists"}