{"id":14972549,"url":"https://github.com/tkrotoff/bootstrap-floating-label","last_synced_at":"2025-09-13T01:17:59.623Z","repository":{"id":34304451,"uuid":"146788385","full_name":"tkrotoff/bootstrap-floating-label","owner":"tkrotoff","description":"Bootstrap 5 Floating Label","archived":false,"fork":false,"pushed_at":"2023-06-03T15:18:27.000Z","size":1225,"stargazers_count":33,"open_issues_count":4,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T17:48:17.196Z","etag":null,"topics":["bootstrap","bootstrap5","float","floating","label"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/tkrotoff.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-30T18:11:31.000Z","updated_at":"2023-04-28T05:26:38.000Z","dependencies_parsed_at":"2024-06-18T22:43:00.489Z","dependency_job_id":"d60517b0-05c4-4f95-abb6-6a7803df377d","html_url":"https://github.com/tkrotoff/bootstrap-floating-label","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkrotoff%2Fbootstrap-floating-label","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkrotoff%2Fbootstrap-floating-label/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkrotoff%2Fbootstrap-floating-label/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkrotoff%2Fbootstrap-floating-label/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tkrotoff","download_url":"https://codeload.github.com/tkrotoff/bootstrap-floating-label/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238394323,"owners_count":19464583,"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":["bootstrap","bootstrap5","float","floating","label"],"created_at":"2024-09-24T13:47:06.565Z","updated_at":"2025-02-12T00:31:46.098Z","avatar_url":"https://github.com/tkrotoff.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @tkrotoff/bootstrap-floating-label\n\n[![npm version](https://badge.fury.io/js/%40tkrotoff%2Fbootstrap-floating-label.svg)](https://www.npmjs.com/package/@tkrotoff/bootstrap-floating-label)\n[![Node.js CI](https://github.com/tkrotoff/bootstrap-floating-label/workflows/Node.js%20CI/badge.svg?branch=master)](https://github.com/tkrotoff/bootstrap-floating-label/actions)\n[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Airbnb Code Style](https://badgen.net/badge/code%20style/airbnb/ff5a5f?icon=airbnb)](https://github.com/airbnb/javascript)\n\nFloating label for Bootstrap 5\n\n\u003cimg src=\"doc/demo.gif\" alt=\"demo\" width=\"191\"\u003e\n\nExample: https://codesandbox.io/s/github/tkrotoff/bootstrap-floating-label/tree/codesandbox.io\n\n- Small: less than 200 lines of [SCSS](src/bootstrap-floating-label.scss)\n- Works with modern browsers\n- Works with any font family and size\n- Uses [Bootstrap variables](https://getbootstrap.com/docs/5.0/customize/sass/#variable-defaults)\n\n⚠️ Latest implementation for Bootstrap 4 is [@tkrotoff/bootstrap-floating-label v0.8](https://github.com/tkrotoff/bootstrap-floating-label/tree/v0.8.0)\n\nThe Nielsen Norman Group talks about [\"Placeholders and Floating Labels disadvantages\"](https://www.nngroup.com/articles/form-design-placeholders/)\n\n## Usage\n\n`npm install @tkrotoff/bootstrap-floating-label`\n\nImport [bootstrap-floating-label.scss](src/bootstrap-floating-label.scss) after bootstrap.scss:\n\n```SCSS\n@import '~bootstrap/scss/bootstrap';\n\n@import '~@tkrotoff/bootstrap-floating-label/src/bootstrap-floating-label';\n```\n\nPlace `\u003clabel\u003e` under `\u003cinput\u003e` inside your [Bootstrap code](https://getbootstrap.com/docs/5.0/forms/overview/):\n\n```HTML\n\u003cdiv class=\"floating-label\"\u003e\n  \u003cinput type=\"email\" id=\"email\" class=\"form-control\" placeholder=\"name@example.com\"\u003e\n  \u003clabel for=\"email\"\u003eEmail\u003c/label\u003e\n\u003c/div\u003e\n```\n\n## Limitations\n\nThere is no good way to [detect if the user entered text inside an input using CSS](https://stackoverflow.com/q/16952526).\n\nThus a placeholder is required `\u003cinput placeholder=\" \"\u003e` otherwise the label will be above the input instead of inside (see https://codepen.io/tkrotoff/pen/KjgyZj).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkrotoff%2Fbootstrap-floating-label","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftkrotoff%2Fbootstrap-floating-label","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkrotoff%2Fbootstrap-floating-label/lists"}