{"id":15383314,"url":"https://github.com/neolegends/dom-flip","last_synced_at":"2025-12-12T04:01:57.658Z","repository":{"id":57214744,"uuid":"98533355","full_name":"NeoLegends/dom-flip","owner":"NeoLegends","description":"🔀 Smooth position animation for web components.","archived":false,"fork":false,"pushed_at":"2018-06-11T16:18:08.000Z","size":47,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T03:37:17.715Z","etag":null,"topics":["animation","flip-animation","list","magic-move","web-component"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/NeoLegends.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-07-27T12:29:29.000Z","updated_at":"2019-09-27T19:35:26.000Z","dependencies_parsed_at":"2022-08-26T13:41:44.232Z","dependency_job_id":null,"html_url":"https://github.com/NeoLegends/dom-flip","commit_stats":null,"previous_names":["festify/dom-flip"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoLegends%2Fdom-flip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoLegends%2Fdom-flip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoLegends%2Fdom-flip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NeoLegends%2Fdom-flip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NeoLegends","download_url":"https://codeload.github.com/NeoLegends/dom-flip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249139480,"owners_count":21219087,"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":["animation","flip-animation","list","magic-move","web-component"],"created_at":"2024-10-01T14:36:51.563Z","updated_at":"2025-12-12T04:01:57.088Z","avatar_url":"https://github.com/NeoLegends.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \\\u003cdom-flip\\\u003e\n\n[![Build Status](https://travis-ci.org/NeoLegends/dom-flip.svg?branch=master)](https://travis-ci.org/NeoLegends/dom-flip)\n[![Greenkeeper badge](https://badges.greenkeeper.io/NeoLegends/dom-flip.svg)](https://greenkeeper.io/)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/NeoLegends/dom-flip)\n\n🔀 Smooth position animation for web components.\n\n[Demo](https://neolegends.github.io/dom-flip/)\n\nThis element is an implementation of the [FLIP-technique](https://aerotwist.com/blog/flip-your-animations/) for arbitrary elements. Simply place it around the elements you indend to reorder and they will smoothly slide over the screen when moved.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/1683034/36944873-d6e8d81e-1fa4-11e8-9253-b1993cdcc794.gif\"\u003e\n\u003c/p\u003e\n\n## Installation\nThis element lives on npm. Install with `yarn add dom-flip` or `npm install --save dom-flip`.\n\n## Usage\nYou can use this element together with any element that modifies the DOM. The animated elements must be direct children of the `dom-flip` element.\n\nTo be able to correlate changes in the model to changes to the DOM, this element requires that you give every element a unique ID. This must be an attribute on the element itself and cannot be a property (because properties cannot be observed via MutationObserver).\n\n### Polymer's dom-repeat:\n```html\n\u003cdom-flip\u003e\n    \u003c!--\n        If you change the order of the elements inside items, the elements will\n        smoothly glide to their new place.\n    --\u003e\n    \u003cdom-repeat items=\"[[items]]\"\u003e\n        \u003ctemplate\u003e\n            \u003cmy-item data-flip-id$=\"[[item.id]]\"\u003e[[item.name]]\u003c/my-item\u003e\n        \u003c/template\n    \u003c/dom-repeat\u003e\n\u003c/dom-flip\u003e\n```\n\n### lit-html:\n```ts\nconst template = (items: { id: string, name: string }[]) =\u003e html`\n    \u003cdom-flip\u003e\n        ${items.map(item =\u003e html`\u003cdiv data-flip-id=\"${item.id}\"\u003e${item.name}\u003c/div\u003e`)}\n    \u003c/dom-flip\u003e\n`;\n\n// Render some items\nconst result = template([\n    { id: \"1\", name: \"Hello\" },\n    { id: \"2\", name: \", \" },\n    { id: \"3\", name: \"World!\" }\n]);\nrender(result, renderNode);\n\n// ... next animation frame\n\n// Change their order\nconst result = template([\n    { id: \"1\", name: \"Hello\" },\n    { id: \"3\", name: \"World!\" },\n    { id: \"2\", name: \", \" }\n]);\n\n// Positions are animated and the items will smoothly glide to their new place\nrender(result, renderNode);\n```\n\n### iron-list\nAlthough we wish it did, this element will not work with `\u003ciron-list\u003e` due to the virtualization. Maybe this can be fixed in the future.\n\n### Automatic registration\nYou can import the custom element class from `dom-flip/element` if you don't want it to automatically be registered within the custom elements registry.\n\n## Performance\nThe element is designed to avoid layout thrashing as much as possible by batching work into microtasks and to animation frame timing.\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneolegends%2Fdom-flip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneolegends%2Fdom-flip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneolegends%2Fdom-flip/lists"}