{"id":20819964,"url":"https://github.com/elo7/tag-amd","last_synced_at":"2025-08-17T14:41:12.064Z","repository":{"id":47876429,"uuid":"68845272","full_name":"elo7/tag-amd","owner":"elo7","description":"Transform any input into a tag container","archived":false,"fork":false,"pushed_at":"2022-12-30T20:04:07.000Z","size":247,"stargazers_count":1,"open_issues_count":18,"forks_count":0,"subscribers_count":88,"default_branch":"master","last_synced_at":"2024-04-30T07:23:35.273Z","etag":null,"topics":["amd","front-end","javascript","lib","martell","nymeros","tags"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elo7.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":"2016-09-21T18:17:28.000Z","updated_at":"2020-07-02T21:24:47.000Z","dependencies_parsed_at":"2023-01-31T15:15:44.161Z","dependency_job_id":null,"html_url":"https://github.com/elo7/tag-amd","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2Ftag-amd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2Ftag-amd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2Ftag-amd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elo7%2Ftag-amd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elo7","download_url":"https://codeload.github.com/elo7/tag-amd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243165933,"owners_count":20246816,"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":["amd","front-end","javascript","lib","martell","nymeros","tags"],"created_at":"2024-11-17T22:07:56.299Z","updated_at":"2025-03-12T06:19:12.418Z","avatar_url":"https://github.com/elo7.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tag-amd\n\nTransform an input into a tag container.\n\n## Dependencies\n\ntag-amd depends on an AMD loader (we recommend [async-define](http://elo7.github.io/async-define/)) and on [doc-amd](http://elo7.github.io/doc-amd/).\n\n## Installation\n\nYou can use either `bower` or `npm` (preferred) to install it into your project:\n\n```\nbower install tag-amd\nnpm install elo7-tag-amd\n```\n\nIn the download package, there will be a JavaScript file (`dist/tag.min.js`) and a CSS file (`dist/tag.min.css`). The CSS file is optional; you may use it as a reference for your own styling.\n\n## Usage\n\nIn your HTML file, import the library and its dependencies (assuming you are using *async-define*):\n\n```html\n\u003cscript src='async-define.js'\u003e\u003c/script\u003e\n\u003cscript src='events-amd.js' async\u003e\u003c/script\u003e\n\u003cscript src='doc.js' async\u003e\u003c/script\u003e\n\u003cscript src='tag.js' async\u003e\u003c/script\u003e\n```\n\n**Important:** `events-amd` its a `doc-amd` [dependency](https://github.com/elo7/doc-amd/#dependencies).\n\nCreate a form control for your user to type the tags using either `\u003cinput\u003e` or `\u003ctextarea\u003e`:\n\n```html\n\u003clabel for='my-tag-field'\u003eType your tags here\u003c/label\u003e\n\u003cinput id='my-tag-field'\u003e\n```\n\n**Important:** do **not** put the tag field inside a `\u003clabel\u003e` element!\n\nThen, in your own JavaScript files, transform the input into a tag field:\n\n```javascript\ndefine(['tag'], function(tag) {\n\ttag.tagify('#my-tag-field');\n});\n```\n\nYou may optionally specify callbacks by passing an object as second argument:\n\n```javascript\ndefine(['tag'], function(tag) {\n\ttag.tagify('#my-tag-field', {\n\t\tadded: function(addedTags) {\n\t\t\tconsole.log('Hey! Here is an array of new tags for you', addedTags);\n\t\t}\n\t});\n});\n```\n\n## API\n\n```javascript\ntag.tagify(cssSelector, options)\n```\n\nwhere `options` is an object that may contain the following callbacks:\n\n- `added(addedTags)`: called when one or more tags are added to the list of tags; receives an array with the new tags as argument\n- `removed(removedTag)`: called when a tag is removed from the list; receives the removed tag as argument\n- `errorAlreadyExists(tagInput)`: called when the user tries to add a tag that already exists in the list; receives the input as argument\n- `errorCleared(tagInput)`: called when the user edits the tag field after an error; receives the input as argument\n- `maxlengthExceeded()`: called when the input's maxlength is reached after adding a tag, **not** when the user is typing the tags; receives no arguments\n\n## License\n\ntag-amd is released under the [BSD license](https://github.com/elo7/tag-amd/blob/master/LICENSE). Have at it.\n\n---\n\nCopyright ©️ 2017 Elo7# tag-amd\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felo7%2Ftag-amd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felo7%2Ftag-amd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felo7%2Ftag-amd/lists"}