{"id":13432848,"url":"https://github.com/tailwindlabs/tailwindcss-forms","last_synced_at":"2025-05-13T15:08:01.860Z","repository":{"id":37330199,"uuid":"312105797","full_name":"tailwindlabs/tailwindcss-forms","owner":"tailwindlabs","description":"A plugin that provides a basic reset for form styles that makes form elements easy to override with utilities.","archived":false,"fork":false,"pushed_at":"2025-01-07T14:02:06.000Z","size":119,"stargazers_count":4395,"open_issues_count":5,"forks_count":226,"subscribers_count":30,"default_branch":"main","last_synced_at":"2025-05-01T02:02:03.134Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tailwindcss-forms.vercel.app","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/tailwindlabs.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":"2020-11-11T22:29:13.000Z","updated_at":"2025-04-30T11:39:24.000Z","dependencies_parsed_at":"2024-04-09T20:49:22.109Z","dependency_job_id":"ac569393-d6c8-4f9b-80f0-40c259f3c5a0","html_url":"https://github.com/tailwindlabs/tailwindcss-forms","commit_stats":{"total_commits":135,"total_committers":20,"mean_commits":6.75,"dds":0.5777777777777777,"last_synced_commit":"02ef4f9e8ca032685afb34d5d521523fd35ce2d8"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailwindlabs%2Ftailwindcss-forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailwindlabs%2Ftailwindcss-forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailwindlabs%2Ftailwindcss-forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailwindlabs%2Ftailwindcss-forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tailwindlabs","download_url":"https://codeload.github.com/tailwindlabs/tailwindcss-forms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252577020,"owners_count":21770721,"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-07-31T02:01:17.494Z","updated_at":"2025-05-05T21:09:54.390Z","avatar_url":"https://github.com/tailwindlabs.png","language":"HTML","funding_links":[],"categories":["HTML","Plugins","others","Running the update","Plugins \u0026 Extensions"],"sub_categories":["By Popularity"],"readme":"# @tailwindcss/forms\n\nA plugin that provides a basic reset for form styles that makes form elements easy to override with utilities.\n\n## Installation\n\nInstall the plugin from npm:\n\n```sh\nnpm install -D @tailwindcss/forms\n```\n\nThen add the plugin to your `tailwind.config.js` file:\n\n```js\n// tailwind.config.js\nmodule.exports = {\n  theme: {\n    // ...\n  },\n  plugins: [\n    require('@tailwindcss/forms'),\n    // ...\n  ],\n}\n```\n\n## Basic usage\n\n[**View the live demo**](https://tailwindcss-forms.vercel.app/)\n\nAll of the basic form elements you use will now have some simple default styles that are easy to override with utilities.\n\nCurrently we add basic utility-friendly form styles for the following form element types:\n\n- `input[type='text']`\n- `input[type='password']`\n- `input[type='email']`\n- `input[type='number']`\n- `input[type='url']`\n- `input[type='date']`\n- `input[type='datetime-local']`\n- `input[type='month']`\n- `input[type='week']`\n- `input[type='time']`\n- `input[type='search']`\n- `input[type='tel']`\n- `input[type='checkbox']`\n- `input[type='radio']`\n- `select`\n- `select[multiple]`\n- `textarea`\n\nEvery element has been normalized/reset to a simple visually consistent style that is easy to customize with utilities, even elements like `\u003cselect\u003e` or `\u003cinput type=\"checkbox\"\u003e` that normally need to be reset with `appearance: none` and customized using custom CSS:\n\n```html\n\u003c!-- You can actually customize padding on a select element now: --\u003e\n\u003cselect class=\"rounded-full px-4 py-3\"\u003e\n  \u003c!-- ... --\u003e\n\u003c/select\u003e\n\n\u003c!-- Or change a checkbox color using text color utilities: --\u003e\n\u003cinput type=\"checkbox\" class=\"rounded text-pink-500\" /\u003e\n```\n\nMore customization examples and best practices coming soon.\n\n### Using classes to style\n\nIn addition to the global styles, we also generate a set of corresponding classes which can be used to explicitly apply the form styles to an element. This can be useful in situations where you need to make a non-form element, such as a `\u003cdiv\u003e`, look like a form element.\n\n```html\n\u003cinput type=\"email\" class=\"form-input rounded-full px-4 py-3\" /\u003e\n\n\u003cselect class=\"form-select rounded-full px-4 py-3\"\u003e\n  \u003c!-- ... --\u003e\n\u003c/select\u003e\n\n\u003cinput type=\"checkbox\" class=\"form-checkbox rounded text-pink-500\" /\u003e\n```\n\nHere is a complete table of the provided `form-*` classes for reference:\n\n| Base                      | Class              |\n| ------------------------- | ------------------ |\n| `[type='text']`           | `form-input`       |\n| `[type='email']`          | `form-input`       |\n| `[type='url']`            | `form-input`       |\n| `[type='password']`       | `form-input`       |\n| `[type='number']`         | `form-input`       |\n| `[type='date']`           | `form-input`       |\n| `[type='datetime-local']` | `form-input`       |\n| `[type='month']`          | `form-input`       |\n| `[type='search']`         | `form-input`       |\n| `[type='tel']`            | `form-input`       |\n| `[type='time']`           | `form-input`       |\n| `[type='week']`           | `form-input`       |\n| `textarea`                | `form-textarea`    |\n| `select`                  | `form-select`      |\n| `select[multiple]`        | `form-multiselect` |\n| `[type='checkbox']`       | `form-checkbox`    |\n| `[type='radio']`          | `form-radio`       |\n\n### Using only global styles or only classes\n\nAlthough we recommend thinking of this plugin as a \"form reset\" rather than a collection of form component styles, in some cases our default approach may be too heavy-handed, especially when integrating this plugin into existing projects.\n\nIf generating both the global (base) styles and classes doesn't work well with your project, you can use the `strategy` option to limit the plugin to just one of these approaches.\n\n```js\n// tailwind.config.js\nplugins: [\n  require(\"@tailwindcss/forms\")({\n    strategy: 'base', // only generate global styles\n    strategy: 'class', // only generate classes\n  }),\n],\n```\n\nWhen using the `base` strategy, form elements are styled globally, and no `form-{name}` classes are generated.\n\nWhen using the `class` strategy, form elements are not styled globally, and instead must be styled using the generated `form-{name}` classes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftailwindlabs%2Ftailwindcss-forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftailwindlabs%2Ftailwindcss-forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftailwindlabs%2Ftailwindcss-forms/lists"}