{"id":42830374,"url":"https://github.com/wide/breakpoint","last_synced_at":"2026-01-30T11:26:57.302Z","repository":{"id":38303014,"uuid":"267884871","full_name":"wide/breakpoint","owner":"wide","description":"Breakpoint observer and helpers.","archived":false,"fork":false,"pushed_at":"2022-06-07T14:53:21.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-09-15T06:22:08.232Z","etag":null,"topics":["modulus"],"latest_commit_sha":null,"homepage":null,"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/wide.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-05-29T14:57:31.000Z","updated_at":"2022-01-18T16:28:23.000Z","dependencies_parsed_at":"2022-08-24T00:31:02.489Z","dependency_job_id":null,"html_url":"https://github.com/wide/breakpoint","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/wide/breakpoint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fbreakpoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fbreakpoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fbreakpoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fbreakpoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wide","download_url":"https://codeload.github.com/wide/breakpoint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fbreakpoint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28911821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T08:15:08.179Z","status":"ssl_error","status_checked_at":"2026-01-30T08:14:31.507Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["modulus"],"created_at":"2026-01-30T11:26:56.582Z","updated_at":"2026-01-30T11:26:57.295Z","avatar_url":"https://github.com/wide.png","language":"JavaScript","readme":"# Breakpoint\r\n\r\nBreakpoint observer with helper methods.\r\n\r\n\r\n## Install\r\n\r\n```\r\nnpm install @wide/breakpoint --save\r\n```\r\n\r\n\r\n## Usage\r\n\r\nInitialize breakpoint observer with custom sizes:\r\n```js\r\nimport breakpoint from '@wide/breakpoint'\r\n\r\nbreakpoint({\r\n  xs: 326,\r\n  sm: 576,\r\n  md: 768,\r\n  lg: 1024,\r\n  xl: 1200,\r\n  xxl: 1600\r\n})\r\n```\r\n\r\n\r\n## Events\r\n\r\nOn window resize, a `breakpoint` event will be triggered if the breakpoint change according to your config:\r\n```js\r\nimport emitter from '@wide/emitter'\r\n\r\nemitter.on('breakpoint', bp =\u003e {})\r\n\r\n// or\r\ndocument.onEvent('breakpoint', bp =\u003e {})\r\n```\r\n\r\nListen to specific breakpoint events:\r\n```js\r\nimport emitter from '@wide/emitter'\r\n\r\nemitter.on('breakpoint.lg', () =\u003e {})\r\n\r\n// or\r\ndocument.onEvent('breakpoint.lg', () =\u003e {})\r\n```\r\n\r\n\r\n## Properties\r\n\r\nGet current breakpoint:\r\n```js\r\nimport { current } from '@wide/breakpoint'\r\n\r\nconsole.log(current) // lg\r\n```\r\n\r\nGet all breakpoints for reference:\r\n```js\r\nimport { breakpoints } from '@wide/breakpoint'\r\n\r\nconsole.log(breakpoints) // { xs: 326, sm: 576, ... }\r\n```\r\n\r\n\r\n## Methods\r\n\r\nResolve mobile-first breakpoint:\r\n```js\r\nimport { up } from '@wide/breakpoint'\r\n\r\n// lg and more : \u003e= 1024\r\nif(up('lg')) {\r\n\r\n}\r\n```\r\n\r\nResolve desktop-first breakpoint:\r\n```js\r\nimport { down } from '@wide/breakpoint'\r\n\r\n// less than lg : \u003c 1024\r\nif(down('lg')) {\r\n\r\n}\r\n```\r\n\r\nResolve range breakpoint:\r\n```js\r\nimport { between } from '@wide/breakpoint'\r\n\r\n// md, lg and xl : \u003e= 768 \u0026\u0026 \u003c 1600\r\nif(between('md', 'xl')) {\r\n\r\n}\r\n```\r\n\r\nResolve range breakpoint (excluding mode):\r\n```js\r\nimport { between } from '@wide/breakpoint'\r\n\r\n// lg and xl : \u003e= 1024 \u0026\u0026 \u003c 1600\r\nif(between('md', 'xxl', false)) {\r\n\r\n}\r\n```\r\n\r\nResolve one breakpoint only:\r\n```js\r\nimport { only } from '@wide/breakpoint'\r\n\r\n// lg to xl excluded : \u003e= 1024 \u0026\u0026 \u003c 1200\r\nif(only('lg')) {\r\n\r\n}\r\n```\r\n\r\n\r\n## Authors\r\n\r\n- **Aymeric Assier** - [github.com/myeti](https://github.com/myeti)\r\n- **Julien Martins Da Costa** - [github.com/jdacosta](https://github.com/jdacosta)\r\n\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [licence](licence) file for details","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwide%2Fbreakpoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwide%2Fbreakpoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwide%2Fbreakpoint/lists"}