{"id":13397977,"url":"https://github.com/rikschennink/short-and-sweet","last_synced_at":"2025-04-05T01:04:53.658Z","repository":{"id":32470636,"uuid":"134812240","full_name":"rikschennink/short-and-sweet","owner":"rikschennink","description":"📟 Accessible character counter for input elements","archived":false,"fork":false,"pushed_at":"2023-03-04T02:41:11.000Z","size":272,"stargazers_count":276,"open_issues_count":4,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-14T07:49:09.044Z","etag":null,"topics":["accessible","character-counter","input","javascript","screenreader","textarea"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/rikschennink.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":["https://www.buymeacoffee.com/rikschennink"]}},"created_at":"2018-05-25T06:20:07.000Z","updated_at":"2024-10-13T20:57:38.000Z","dependencies_parsed_at":"2024-01-18T10:47:00.818Z","dependency_job_id":null,"html_url":"https://github.com/rikschennink/short-and-sweet","commit_stats":{"total_commits":17,"total_committers":3,"mean_commits":5.666666666666667,"dds":"0.17647058823529416","last_synced_commit":"b09e06ccb4356b0d3f6f4d7fc954f64360ad35c6"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikschennink%2Fshort-and-sweet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikschennink%2Fshort-and-sweet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikschennink%2Fshort-and-sweet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikschennink%2Fshort-and-sweet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rikschennink","download_url":"https://codeload.github.com/rikschennink/short-and-sweet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271518,"owners_count":20911587,"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":["accessible","character-counter","input","javascript","screenreader","textarea"],"created_at":"2024-07-30T18:01:59.385Z","updated_at":"2025-04-05T01:04:53.636Z","avatar_url":"https://github.com/rikschennink.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/rikschennink","https://www.buymeacoffee.com/rikschennink/"],"categories":["JavaScript"],"sub_categories":[],"readme":"# Short and Sweet, Accessible Character Counter\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/rikschennink/short-and-sweet/blob/gh-pages/LICENSE)\n[![npm version](https://badge.fury.io/js/short-and-sweet.svg)](https://badge.fury.io/js/short-and-sweet)\n\nTested with VoiceOver (Safari 11) \u0026 NVDA (FF 60)\n\n-   Tells user the amount of space left when the field is focussed\n-   Updates the user periodically while typing\n\nPlay around with the demo:\n\nhttps://codepen.io/rikschennink/pen/LmoJYY\n\nView a video of Short and Sweet with VoiceOver:\n\nhttp://www.youtube.com/watch?v=3NDCEvHHaCY (sound is off)\n\n---\n\n[\u003cimg src=\"https://github.com/rikschennink/short-and-sweet/blob/master/header.svg\" alt=\"\"/\u003e](https://www.buymeacoffee.com/rikschennink/)\n\n[Buy me a Coffee](https://www.buymeacoffee.com/rikschennink/) / [Dev updates on Twitter](https://twitter.com/rikschennink/)\n\n---\n\n## Features\n\n-   No dependencies\n-   Easy setup\n-   Accessible\n\n## Installation\n\nInstall from npm:\n\n```\nnpm install short-and-sweet --save\n```\n\nOr download `dist/short-and-sweet.min.js` and include the script on your page like shown below.\n\n## Usage\n\nRun short-and-sweet like shown below and pass an element reference or a querySelector. For best performance include the script just before the closing `\u003c/body\u003e` element.\n\n```html\n\u003ctextarea maxlength=\"200\"\u003e\u003c/textarea\u003e\n\n\u003cscript src=\"short-and-sweet.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    shortAndSweet('textarea', {\n        counterClassName: 'my-short-and-sweet-counter',\n    });\n\u003c/script\u003e\n```\n\nThe following options are available to pass to the `shortAndSweet` method.\n\n| Option             | Default                                                    | Description                                                                                                          |\n| ------------------ | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |\n| `counterClassName` | `'short-and-sweet-counter'`                                | The classname of the counter element                                                                                 |\n| `counterLabel`     | `'{remaining} characters left'`                            | The text shown in the counter element, placeholders available are `{remaining}`, `{maxlength}`, `{length}`           |\n| `assistDelay`      | `2000`                                                     | The time in milliseconds the assist waits before updating the user with the screenreader user with the current count |\n| `append`           | `(el, counter) =\u003e { el.parentNode.appendChild(counter); }` | The method used to append the element to the DOM                                                                     |\n\n## Tested\n\n-   Modern browsers\n-   VoiceOver + Safari\n-   NVDA + Firefox\n-   IE 10+\n\n## Versioning\n\nVersioning follows [Semver](http://semver.org).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frikschennink%2Fshort-and-sweet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frikschennink%2Fshort-and-sweet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frikschennink%2Fshort-and-sweet/lists"}