{"id":15313865,"url":"https://github.com/itsdouges/react-connect-the-dots","last_synced_at":"2026-02-04T13:43:09.560Z","repository":{"id":65372705,"uuid":"103611936","full_name":"itsdouges/react-connect-the-dots","owner":"itsdouges","description":"⭕ Dynamically positions a component between two elements, for React.js","archived":false,"fork":false,"pushed_at":"2017-10-30T06:52:53.000Z","size":583,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T02:56:27.802Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://madou.github.io/react-connect-the-dots","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/itsdouges.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}},"created_at":"2017-09-15T03:57:17.000Z","updated_at":"2025-02-11T15:49:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"9dc874eb-38e4-48ed-8712-d6f37ede2210","html_url":"https://github.com/itsdouges/react-connect-the-dots","commit_stats":null,"previous_names":["madou/react-connect-the-dots"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/itsdouges/react-connect-the-dots","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsdouges%2Freact-connect-the-dots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsdouges%2Freact-connect-the-dots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsdouges%2Freact-connect-the-dots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsdouges%2Freact-connect-the-dots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsdouges","download_url":"https://codeload.github.com/itsdouges/react-connect-the-dots/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsdouges%2Freact-connect-the-dots/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265190796,"owners_count":23725232,"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-10-01T08:43:26.560Z","updated_at":"2026-02-04T13:43:09.520Z","avatar_url":"https://github.com/itsdouges.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [react-connect-the-dots](https://github.com/madou/react-connect-the-dots)\n\n[![NPM version](http://img.shields.io/npm/v/react-connect-the-dots.svg?style=flat-square)](https://www.npmjs.com/package/react-connect-the-dots)\n[![NPM downloads](http://img.shields.io/npm/dm/react-connect-the-dots.svg?style=flat-square)](https://www.npmjs.com/package/react-connect-the-dots)\n[![Build Status](http://img.shields.io/travis/madou/react-connect-the-dots/master.svg?style=flat-square)](https://travis-ci.org/madou/react-connect-the-dots)\n[![codecov](https://codecov.io/gh/madou/react-connect-the-dots/branch/master/graph/badge.svg)](https://codecov.io/gh/madou/react-connect-the-dots)\n[![Dependency Status](http://img.shields.io/david/madou/react-connect-the-dots.svg?style=flat-square)](https://david-dm.org/madou/react-connect-the-dots)\n\nPositions an component `connector` between two components. Wrap a from and to component, give them a pair name, and customise the line as you see fit.\nExplicitly a client side _only_ solution.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/madou/react-connect-the-dots/blob/master/example.gif?raw=true\" style=\"margin:0 auto\" /\u003e\n\u003c/p\u003e\n\n## Installation\n\n```sh\nnpm install react-connect-the-dots\n```\n\n## Usage\n\n### `\u003cDot /\u003e`\n\nYou can wrap components in a `Dot` to draw a connector between them.\nEach connector `pair` should only have two `Dots`, if you try to add\nmore an exception will be thrown.\n\n`Dot`s can be nested! Only the deepest `Dot` needs a function as children.\n\n```javascript\nimport Dot from 'react-connect-the-dots';\n\nconst CustomComponent = ({ getRef }) =\u003e (\n  \u003cdiv ref={getRef}\u003ehello\u003c/div\u003e\n);\n\nconst App = () =\u003e (\n  \u003cdiv className=\"relative-position-container\"\u003e\n\n    \u003cDot pair=\"a-b\" connector={(props) =\u003e \u003cdiv className=\"sweet-line\" {...props} /\u003e}\u003e\n      {(ref) =\u003e \u003cCustomComponent className=\"position-top-left\" getRef={ref} /\u003e}\n    \u003c/Dot\u003e\n\n    \u003cDot pair=\"b-c\" connector={(props) =\u003e \u003cdiv className=\"sweet-line thicc\" {...props} /\u003e}\u003e\n      \u003cDot pair=\"a-b\"\u003e\n        {(ref) =\u003e \u003cCustomComponent className=\"position-bottom-left\" getRef={ref} /\u003e}\n      \u003c/Dot\u003e\n    \u003c/Dot\u003e\n\n    \u003cDot pair=\"b-c\"\u003e\n      {(ref) =\u003e \u003cCustomComponent className=\"position-bottom-right\" getRef={ref} /\u003e}\n    \u003c/Dot\u003e\n  \u003c/div\u003e\n);\n```\n\n| prop | type | required | description |\n|-|-|-|-|\n| pair | `string`  | yes | The name that each dot pair will share. |\n| connector | `(props) =\u003e Node` | no | The connector to be drawn between dots. This can be on all, one, or none for a `Dot` pair. |\n| children | `(ref) =\u003e Node` or `Dot` | yes | |\n\n### React Story Book\n\nTo run the component in various modes, run the following command then go to `http://localhost:6006/`.\n\n```bash\nnpm start\n```\n\n### Testing\n\n```bash\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsdouges%2Freact-connect-the-dots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsdouges%2Freact-connect-the-dots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsdouges%2Freact-connect-the-dots/lists"}