{"id":32257968,"url":"https://github.com/petarjs/smart-email-field","last_synced_at":"2026-07-11T18:31:31.156Z","repository":{"id":57146559,"uuid":"60626773","full_name":"petarjs/smart-email-field","owner":"petarjs","description":"Smart Email Field adds autocompletion of popular email domains to your inputs.","archived":false,"fork":false,"pushed_at":"2016-06-17T18:13:09.000Z","size":212,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"gh-pages","last_synced_at":"2026-01-14T08:56:48.181Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://petarjs.github.io/smart-email-field/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/petarjs.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-07T15:55:55.000Z","updated_at":"2018-11-13T21:19:41.000Z","dependencies_parsed_at":"2022-08-31T01:01:39.959Z","dependency_job_id":null,"html_url":"https://github.com/petarjs/smart-email-field","commit_stats":null,"previous_names":["petarslovic/smart-email-field"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/petarjs/smart-email-field","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petarjs%2Fsmart-email-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petarjs%2Fsmart-email-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petarjs%2Fsmart-email-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petarjs%2Fsmart-email-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petarjs","download_url":"https://codeload.github.com/petarjs/smart-email-field/tar.gz/refs/heads/gh-pages","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petarjs%2Fsmart-email-field/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35372639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"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":[],"created_at":"2025-10-22T19:40:38.554Z","updated_at":"2026-07-11T18:31:31.149Z","avatar_url":"https://github.com/petarjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart Email Field\n\nSmart Email Field adds autocompletion of popular email domains to your inputs.  \nRight arrow autocompletes the suggestion.\n\n![Smart Email Field](images/smart-email-field.gif)\n\n## Demo\nhttp://petarslovic.github.io/smart-email-field/\n\n## Dependencies\n\nNo dependencies. Vanilla JS.\n\n## Install\n\n### Get the files\n  NPM  \n    `npm install smart-email-field --save`\n\n  Bower  \n    `bower install smart-email-field --save`\n\n### Include the files in your app\n\n```html\n  \u003cscript src=\"smart-email-field.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n**Important - Email fields must have ID attributes, otherwise the plugin won't work as expected.**  \n\nThere are a few ways to instantiate the plugin.  \nGiven a few email fields:\n\n```html\n\u003cinput type=\"email\" class=\"email-field\"\u003e\n\u003cinput type=\"email\" class=\"email-field\"\u003e\n\u003cinput type=\"email\" id=\"email-1\"\u003e\n```\n\n#### Via selector\n```js\nvar smartEmail = new SmartEmailField('.email-field')\n```\nThis will make only the first input into a SmartEmailField. SmartEmailField uses `document.querySelector` if you pass a string.\n\n#### Via DOM Element\n```js\nvar emailElement = document.querySelector('#email-1');\nvar smartEmail1 = new SmartEmailField(emailElement);\n```\n\n#### If you are using jQuery\n```js\nvar $email = $('#emial-1');\nvar smartEmail1 = new SmartEmailField($email.get(0));\n// or\nvar smartEmail1 = new SmartEmailField($email[0]);\n```\n\n#### If you have multiple email fields on the page\n```js\n[].slice.call(document.querySelectorAll('.my-email')).map(el =\u003e new SmartEmailField(el));\n```\n\njQuery:\n```js\n$('.my-email').each($el =\u003e new SmartEmailField($el[0]));\n```\n\n\n## Configuration\n\nTo configure SmartEmailField, pass options as the second parameter to constructor:\n```js\n  var myEmail = new SmartEmailField('#my-email', {\n    shadowStyle: {\n      color: 'rgba(0, 0, 0, 0.3)'\n    }\n  })\n```\n\n#### Options\n\n- **shadowStyle**  \nSet the style of the shadow element. This affects the background color of the email field, or the color of autocomplete text, or any other property.\n\n```js\nnew SmartEmailField('#my-email', {\n  shadowStyle: {\n    color: 'rgba(0, 0, 0, 0.3)',\n    background: 'yellow'\n  }\n})\n```\n\n- **emailDomains**  \nSet the list of email domains to use for autocompletion. Use it to override the default list (which can be seen in the plugin, as `EMAIL_DOMAINS` variable).\n\n```js\nnew SmartEmailField('#my-email', {\n  emailDomains: ['gmail.com', 'yahoo.com']\n})\n```\n\n## How it works\n\nIt's pretty simple:  \n- we have a email field\n- we wrap it with a div\n- add a shadow div behind\n- copy the styles of email field to shadow div\n- make email field's background transparent, so we can see the shadow field\n- fill shadow field with suggestion text\n\n\n## Drawbacks\n\n- If you want to style pseudo classes of the email field, you'll need to target the shadow element.\n- Missing mobile support. Maybe autocomplete on tap?","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetarjs%2Fsmart-email-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetarjs%2Fsmart-email-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetarjs%2Fsmart-email-field/lists"}