{"id":13406246,"url":"https://github.com/floating-ui/floating-ui","last_synced_at":"2025-12-12T01:05:35.231Z","repository":{"id":36969494,"uuid":"54994103","full_name":"floating-ui/floating-ui","owner":"floating-ui","description":"A JavaScript library to position floating elements and create interactions for them.","archived":false,"fork":false,"pushed_at":"2025-08-21T06:33:46.000Z","size":41080,"stargazers_count":31746,"open_issues_count":33,"forks_count":1648,"subscribers_count":254,"default_branch":"master","last_synced_at":"2025-09-07T14:57:12.966Z","etag":null,"topics":["dropdown","hacktoberfest","popover","popovers","position","positioning","positioning-engine","tooltip","tooltip-position"],"latest_commit_sha":null,"homepage":"https://floating-ui.com","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/floating-ui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null},"funding":{"open_collective":"popperjs","tidelift":"npm/@popperjs/core"}},"created_at":"2016-03-29T17:00:47.000Z","updated_at":"2025-09-07T14:22:10.000Z","dependencies_parsed_at":"2024-03-15T02:14:53.960Z","dependency_job_id":"caf5e96f-ba4a-42d7-aaaf-bdc81a9d20a4","html_url":"https://github.com/floating-ui/floating-ui","commit_stats":{"total_commits":2054,"total_committers":115,"mean_commits":"17.860869565217392","dds":0.3865628042843233,"last_synced_commit":"f1d95ac5ba8ce6eee128915c983326fbf0387cef"},"previous_names":["fezvrasta/popper.js","popperjs/popper-core","popperjs/popper.js"],"tags_count":523,"template":false,"template_full_name":null,"purl":"pkg:github/floating-ui/floating-ui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floating-ui%2Ffloating-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floating-ui%2Ffloating-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floating-ui%2Ffloating-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floating-ui%2Ffloating-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/floating-ui","download_url":"https://codeload.github.com/floating-ui/floating-ui/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/floating-ui%2Ffloating-ui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274101784,"owners_count":25222446,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["dropdown","hacktoberfest","popover","popovers","position","positioning","positioning-engine","tooltip","tooltip-position"],"created_at":"2024-07-30T19:02:25.140Z","updated_at":"2025-12-12T01:05:35.195Z","avatar_url":"https://github.com/floating-ui.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/floating-ui/floating-ui/blob/master/website/assets/floating-ui-banner.png\" alt=\"Floating UI\" width=\"70%\"\u003e\n\u003cp\u003e\n\n\u003e [!NOTE]\n\u003e Popper is now Floating UI! For Popper v2, visit\n\u003e [its dedicated branch](https://github.com/floating-ui/floating-ui/tree/v2.x) and [its documentation](https://popper.js.org/docs).\n\u003e For help on migrating, check out the\n\u003e [Migration Guide.](https://floating-ui.com/docs/migration)\n\n[Floating UI](https://floating-ui.com) is a small library that helps you create\n\"floating\" elements such as tooltips, popovers, dropdowns, and more.\n\nIt offers two main features:\n\n1. **Anchor positioning**: Anchor a floating element (such as a tooltip) to\n   another element (such as a button) while simultaneously ensuring it stays in\n   view as best as possible by avoiding collisions. This feature is available\n   for all platforms.\n2. **User interactions for React**: Hooks and components for composing\n   interactions to create accessible floating UI components.\n\n## README Contributors\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://milfordasset.com/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg width=\"176\" height=\"150\" src=\"https://github.com/floating-ui/floating-ui/blob/master/website/assets/sponsors/milford.svg\" alt=\"Milford\" /\u003e\u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://dopt.com/?utm_source=floating_ui_readme\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg width=\"200\" height=\"150\" src=\"https://github.com/floating-ui/floating-ui/blob/master/website/assets/sponsors/dopt.png\" alt=\"Dopt\" /\u003e\u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nYou can support Floating UI in a variety of ways on\n[Open Collective](https://opencollective.com/floating-ui).\n\n## Why\n\nFloating elements are absolutely positioned, typically anchored to another UI\nelement. Ensuring a floating element remains anchored next to another element\ncan be challenging, especially in unique layout contexts like scrolling\ncontainers.\n\nAbsolute positioning can also cause problems when the floating element is too\nclose to the edge of the viewport and becomes obscured, also known as a\ncollision. When a collision occurs, the position must be adjusted to ensure the\nfloating element remains visible.\n\nFurther, floating elements are often interactive, which can raise complex\naccessibility issues when designing user interactions.\n\nFloating UI offers a set of low-level features to help you navigate these\nchallenges and build accessible floating UI components.\n\n## Install\n\nTo install Floating UI, you can use a package manager like npm or a\n[CDN](https://floating-ui.com/docs/getting-started#cdn). There are different\nversions available for different platforms.\n\n### Vanilla\n\nUse on the web with vanilla JavaScript.\n\n```shell\nnpm install @floating-ui/dom\n```\n\nYou can either start by\n[reading the tutorial](https://floating-ui.com/docs/tutorial), which teaches you\nhow to use the library by building a basic tooltip, or you can jump right into\nthe [API documentation](https://floating-ui.com/docs/computePosition).\n\n### React\n\nUse with [React DOM](https://floating-ui.com/docs/react) or\n[React Native](https://floating-ui.com/docs/react-native).\n\n#### React DOM\n\n```shell\n# Positioning + interactions\nnpm install @floating-ui/react\n\n# Positioning only (smaller size)\nnpm install @floating-ui/react-dom\n```\n\n#### React Native\n\n```shell\nnpm install @floating-ui/react-native\n```\n\n### Vue\n\nUse with [Vue](https://floating-ui.com/docs/vue).\n\n```shell\nnpm install @floating-ui/vue\n```\n\n### Canvas or other platforms\n\nIf you're targeting a platform other than the vanilla DOM (web), React, or React\nNative, you can create your own\n[Platform](https://floating-ui.com/docs/platform). This allows you to support\nthings like Canvas/WebGL, or other platforms that can run JavaScript.\n\n```shell\nnpm install @floating-ui/core\n```\n\n## Contributing\n\nThis project is a monorepo written in TypeScript using [pnpm](https://pnpm.io/)\nworkspaces. The website is using Next.js SSG and Tailwind CSS for styling.\n\n- Fork and clone the repo\n- Install dependencies in root directory with `pnpm install`\n- Build initial package dist files with `pnpm run build`\n\n### Testing grounds\n\n#### DOM\n\n`pnpm run --filter @floating-ui/dom dev` in the root will launch the\n`@floating-ui/dom` development visual tests at `http://localhost:1234`. The\nplayground uses React to write each test route, bundled by Vite.\n\nEach route has screenshots taken of the page by Playwright to ensure all the\nfunctionalities work as expected; this is an easy, reliable and high-level way\nof testing the positioning logic.\n\nBelow the main container are UI controls to turn on certain state and options.\nEvery single combination of state is tested visually via the snapshots to cover\nas much as possible.\n\n#### React\n\n`pnpm run --filter @floating-ui/react dev` in the root will launch the\n`@floating-ui/react` development tests at `http://localhost:1234`.\n\n## Credits\n\nThe floating shapes in the banner image are made by the amazing artists\n[@artstar3d](https://figma.com/@artstar3d),\n[@killnicole](https://figma.com/@killnicole) and\n[@liiiiiiii](https://www.figma.com/@liiiiiii) on Figma — check out their work!\n\n## License\n\nMIT\n","funding_links":["https://opencollective.com/popperjs","https://tidelift.com/funding/github/npm/@popperjs/core","https://opencollective.com/floating-ui"],"categories":["TypeScript","hacktoberfest",":books: Libraries","前端开发框架及项目","UI Gestures \u0026 Tools","UI Components","语言资源库","Uncategorized"],"sub_categories":["React","其他_文本生成、文本对话","Tooltips / popovers / dropdowns","typescript","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloating-ui%2Ffloating-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloating-ui%2Ffloating-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloating-ui%2Ffloating-ui/lists"}