{"_id":"use-clamp-text","_rev":"3-830ff128e698c5ff08e6c6e12ac04b38","name":"use-clamp-text","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"use-clamp-text","description":"react hook to clamp multiline text to a given height in a responsive way (in < 2.5kb)","version":"1.0.0","main":"lib/index.js","module":"esm/index.js","types":"./lib","sideEffects":false,"scripts":{"size":"yarn build:es && size-limit","build":"rm -rf ./lib/* ./esm/* && yarn size && yarn build:cjs && yarn build:es","build:cjs":"tsc","build:es":"tsc -m esNext --outDir esm","prepublishOnly":"yarn build"},"engines":{"node":">=12.0.0"},"repository":{"type":"git","url":"git+ssh://git@github.com/drenther/use-clamp-text.git"},"keywords":["react","react-hook","hook","clamp","text","clamp-text","multiline","responsive"],"peerDependencies":{"react":">=16.8.0"},"homepage":"https://github.com/drenther/use-clamp-text#readme","author":{"name":"Soumyajit Pathak"},"license":"MIT","dependencies":{"rooks":"^5.11.0"},"devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/react":"^18.0.8","@types/react-dom":"^18.0.3","@typescript-eslint/eslint-plugin":"^5.21.0","@typescript-eslint/parser":"^5.21.0","eslint":"^8.14.0","eslint-config-prettier":"^8.5.0","eslint-config-react-app":"^7.0.1","prettier":"^2.6.2","react":"^18.1.0","react-dom":"^18.1.0","size-limit":"^7.0.8","typescript":"^4.6.4"},"size-limit":[{"path":"esm/index.js","limit":"2.5 KB"}],"licenseText":"MIT License\n\nCopyright (c) 2022 Soumyajit Pathak\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-clamp-text@1.0.0","dist":{"shasum":"ecc4bab9199ec564916434df8867c4d7e30b95e5","integrity":"sha512-8Shj9fBzR1MSN+GHhIL14rD6I3/7+Eo8aluLbig0d6Nlc1BljUfY184jL6G+lrnLL/rluAhYf8LQq9Qlpe5HxA==","tarball":"https://registry.npmjs.org/use-clamp-text/-/use-clamp-text-1.0.0.tgz","fileCount":13,"unpackedSize":15953,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEIlUO9BBb3nNhFV80OX/qo9bY9xXLyrTptjMtsQIwayAiEA7oZPiolhUWc8idsIFP0MtcGYGN6McCRHrY4ljuXu0n0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJia+WYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4YQ//Yfr2dkjlrHu4HpsZaZvFtIJD9hss4h06LMJcQMPSf1ASaYG6\r\nYRRs9abl4Hz0LFpdsWx2WXMRgYe3sgEIF76ydIgL9RmgDELACfvQbqzVEktI\r\nPiyPttTMVTNrPKWqUUZmHrLHTgAfw3Nu+2xTr82xhm+tgroUdll8ZxkcNx3m\r\nOtrusz5qOz8XCdeF2JT20XlgwqYRnR17eF7mPCYj9/GjE9AzFkYsWdZ8z5Uo\r\n/NDrPfVSdT0Zb11q0vAI1TjJpovEWNY3sND2EEijm/r+xV3Tb68e+40L5a41\r\n2U3emnZYvvZ0S8dv7l2v5+kzwqADN3sPdDis2PksfCzMFiSfYF6u9A3KvPQT\r\nvGY2GmaKNcSmQbGIV9AgsBOdEGIcjtcgRA/FOei4Hy+IbY3gNLhbkHUDuk8f\r\npzCLlM4NPblH/HF39E+DL/tLwWLG/4u1R7lmuPuW1ORYNY2SLFTzkZP04yOs\r\nPps+jguDyerNw/CcOjgPWldhHgb1Z6iyxPyufTV/Sz6sYVakk9UQPLN9tXTC\r\nIgLXqqFI6ha5e7n1/LiPnaHIJHYG94+eoDx25ZRGnackokj9ZXNkvxfp3F7D\r\nsFIVHQ2DXbLV7IcOWF6/GySjNcSgEHF9/uKh/grNy2keqy9gE8Pz7Wr6LgnE\r\n6GsFCwoQV4vDLCQnkDrBAULbWFn+y7003yA=\r\n=ZBga\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"drenther","email":"s.pathak5995@gmail.com"},"directories":{},"maintainers":[{"name":"drenther","email":"s.pathak5995@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-clamp-text_1.0.0_1651238296054_0.22798759708208038"},"_hasShrinkwrap":false},"1.0.1":{"name":"use-clamp-text","description":"react hook to clamp multiline text to a given height in a responsive way (in < 2.5kb)","version":"1.0.1","main":"lib/index.js","module":"esm/index.js","types":"./lib","sideEffects":false,"scripts":{"size":"yarn build:es && size-limit","build":"rm -rf ./lib/* ./esm/* && yarn size && yarn build:cjs && yarn build:es","build:cjs":"tsc","build:es":"tsc -m esNext --outDir esm","prepublishOnly":"yarn build"},"engines":{"node":">=12.0.0"},"repository":{"type":"git","url":"git+ssh://git@github.com/drenther/use-clamp-text.git"},"keywords":["react","react-hook","hook","clamp","text","clamp-text","multiline","responsive"],"peerDependencies":{"react":">=16.8.0"},"homepage":"https://github.com/drenther/use-clamp-text#readme","author":{"name":"Soumyajit Pathak"},"license":"MIT","dependencies":{"rooks":"^5.11.0"},"devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/react":"^18.0.8","@types/react-dom":"^18.0.3","@typescript-eslint/eslint-plugin":"^5.21.0","@typescript-eslint/parser":"^5.21.0","eslint":"^8.14.0","eslint-config-prettier":"^8.5.0","eslint-config-react-app":"^7.0.1","prettier":"^2.6.2","react":"^18.1.0","react-dom":"^18.1.0","size-limit":"^7.0.8","typescript":"^4.6.4"},"size-limit":[{"path":"esm/index.js","limit":"2.5 KB"}],"licenseText":"MIT License\n\nCopyright (c) 2022 Soumyajit Pathak\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-clamp-text@1.0.1","dist":{"shasum":"05d7572169a9bcf51c8446781bbdf5a13fab8e68","integrity":"sha512-xc2suDeO05C3sZWLDyawC5siBrug9oXPIYxuewtsVZam2rLEXFXYHDGJuoAI8pHD+h+/HiR0DkxuU/2Lddf0uA==","tarball":"https://registry.npmjs.org/use-clamp-text/-/use-clamp-text-1.0.1.tgz","fileCount":13,"unpackedSize":16336,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBgK69Gy5vgh2bwslPHb6b4OlV+g6BqFLgm6OytWCGz1AiEAmc+pfVwvUX9IMd2sJVkR+xCHsMEFWzQDQpwJPE5eAXA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJib78lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVPRAAk9k+q/cRVbUUHk82f5pLDM/u5JHnqUGe68WP27xRhUvwxXIj\r\nMzESyWcfO/xjRnDbK6O3rp6zdocvJZVR/OuLxiZSN44gceVrBZ4YNp4Ff6HU\r\npev7vEN4UIib6OkaXb6wSFVdU1iUP/xsIm/tYXwjx4pdizd4Cl94Us6IN3q6\r\n4VE0X2k6sqLHFbgOteRUibLEBamNRiZcxlZYU/RdjrnAQEMqqLju5rWbCs7i\r\nBSeWcH5hDfDX6BqZnAG4goBsuvYDXXkyj9kBKeCXnfttCQxnO5JUXhLRyM+Z\r\njXE7nmfFG6SD41+sinfvmSCAE9fdEK2f+QoFUAJYouBe4Wrr4atcu4+ga/y7\r\nqj294unX5jVcCYoU3pATIU7wJcFsy3q6cwye6+FFB9b2UzcgtvDybBU7cE1Y\r\nxBsWPSXHYN00ftW4xAM2kbqzUGa2Z8XTrorMGsWP+bu+bYQ/9wLD3Y1Spx/6\r\nzah8LVCeAn28wGbnF73JRUPUd2dKLYucDumFeOtACX3hbJRebUWgSFR8lKqG\r\nkTln/pgGyHqHPVtMuqHkPIfHIlFNxTS4WI6u6WOL+o23NG2lEwlUAicHmEc+\r\nwJsuPEII5NTkuM0NhhlP636K2vnXoTaxZNq4j/xEoQtd7ZfKrQvbikcK84wb\r\n5odWqZviJnnGF7ecmIH+V2qlFqRIUHrnPiw=\r\n=96nK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"drenther","email":"s.pathak5995@gmail.com"},"directories":{},"maintainers":[{"name":"drenther","email":"s.pathak5995@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-clamp-text_1.0.1_1651490597451_0.045175294863756044"},"_hasShrinkwrap":false},"1.1.0":{"name":"use-clamp-text","description":"react hook to clamp multiline text to a given height in a responsive way (in < 2.5kb)","version":"1.1.0","main":"lib/index.js","module":"esm/index.js","types":"./lib","sideEffects":false,"scripts":{"size":"yarn build:es && size-limit","build":"rm -rf ./lib/* ./esm/* && yarn size && yarn build:cjs && yarn build:es","build:cjs":"tsc","build:es":"tsc -m esNext --outDir esm","prepublishOnly":"yarn build"},"engines":{"node":">=12.0.0"},"repository":{"type":"git","url":"git+ssh://git@github.com/drenther/use-clamp-text.git"},"keywords":["react","react-hook","hook","clamp","text","clamp-text","multiline","responsive"],"peerDependencies":{"react":">=16.8.0"},"homepage":"https://github.com/drenther/use-clamp-text#readme","author":{"name":"Soumyajit Pathak"},"license":"MIT","dependencies":{"rooks":"^5.11.0"},"devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/react":"^18.0.8","@types/react-dom":"^18.0.3","@typescript-eslint/eslint-plugin":"^5.21.0","@typescript-eslint/parser":"^5.21.0","eslint":"^8.14.0","eslint-config-prettier":"^8.5.0","eslint-config-react-app":"^7.0.1","prettier":"^2.6.2","react":"^18.1.0","react-dom":"^18.1.0","size-limit":"^7.0.8","typescript":"^4.6.4"},"size-limit":[{"path":"esm/index.js","limit":"3 KB"}],"licenseText":"MIT License\n\nCopyright (c) 2022 Soumyajit Pathak\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-clamp-text@1.1.0","dist":{"shasum":"5c209936bf5409a10e88f98af475646c7bceaa8c","integrity":"sha512-1tvJVgWAe7uM7K8o4uuzrpkBFDTVPOgp08nBosRrQrbFHK5ffZR3UYok3WeqnI8Mhvll2zt7SlmerEhYrnkwHA==","tarball":"https://registry.npmjs.org/use-clamp-text/-/use-clamp-text-1.1.0.tgz","fileCount":13,"unpackedSize":21749,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDPteay70SeQB5BWOd+Rw7hCm2hcWMt63Rq4S+vzYVW/AiEAyvvjISQHS1A8N5DClWYfBazh7htYbE+8RhJqFPrf/wk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJib93xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRTBAAlWsVPoCp7HexXmUgb7dt23pnnJCPdjf8GveZdM1N2ojGlDwL\r\nlnqk6dMMJ5TWfvqwf3HnNSD3mOCx9EwWYRRNhxNDZbGGA/JXYryXv5Cg1ms3\r\nRK+/MsYN6yUNiVHlL+Ch/lp/5f0e6DzPfWkaF8ZjQFi6HCsl7K2ZtTatm+ad\r\nbtSDNK4bnZSbcJK6eVZCZke7cX4jK9Flr+pjeTKgOKTLKrNguUxjeygs5p32\r\nFP+D9WgFKRGSFdVZviwuV0rB6NGNNzX0CFgfriwfOgpO3j4I0hkG/AcZ83/5\r\nU1a71UnZkLQmS803uZip5HT9Ni1tWoaKRgI6wxx3DsWWWaRa/jM1SwUuHmhq\r\nibYn1HyhSDDR7p4MCQm806B8hVAqYVj2B1blGW6bjoLbn1ek1V6FFTcknzZ7\r\nQhiYQ6icTs8cP1uaHxLjJtWCCRmPLRjYVqoTxbTaz9/+wSoUSQBEuB6q8Bpz\r\nKb422SlS9TUxRKu38B417epWrJ0EHRkIkxVcHA2I3ZyDdEehQzNXSzznfRBL\r\ne/rb0vWXKQ4Cmeioh/g0yl0RxmdIV4lLsEXu+vf/kSvCkPfQ/r6woV3Yzv5i\r\nGhdpCcdWv9EK2Y18Fu0lvZYMUuJk+FxLYJgL7KxHYDF6ZWb4otkaiYb/PLdi\r\nvcwtGroiD/VhU5/vRXmHDk2yGCeCbP9UI04=\r\n=g6lf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"drenther","email":"s.pathak5995@gmail.com"},"directories":{},"maintainers":[{"name":"drenther","email":"s.pathak5995@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-clamp-text_1.1.0_1651498481116_0.9340455341129339"},"_hasShrinkwrap":false},"1.1.1":{"name":"use-clamp-text","description":"react hook to clamp multiline text to a given height in a responsive way (in < 2.5kb)","version":"1.1.1","main":"lib/index.js","module":"esm/index.js","types":"./lib","sideEffects":false,"scripts":{"size":"yarn build:es && size-limit","build":"rm -rf ./lib/* ./esm/* && yarn size && yarn build:cjs && yarn build:es","build:cjs":"tsc","build:es":"tsc -m esNext --outDir esm","prepublishOnly":"yarn build"},"engines":{"node":">=12.0.0"},"repository":{"type":"git","url":"git+ssh://git@github.com/drenther/use-clamp-text.git"},"keywords":["react","react-hook","hook","clamp","text","clamp-text","multiline","responsive"],"peerDependencies":{"react":">=16.8.0"},"homepage":"https://github.com/drenther/use-clamp-text#readme","author":{"name":"Soumyajit Pathak"},"license":"MIT","dependencies":{"rooks":"^5.11.0"},"devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/react":"^18.0.8","@types/react-dom":"^18.0.3","@typescript-eslint/eslint-plugin":"^5.21.0","@typescript-eslint/parser":"^5.21.0","eslint":"^8.14.0","eslint-config-prettier":"^8.5.0","eslint-config-react-app":"^7.0.1","prettier":"^2.6.2","react":"^18.1.0","react-dom":"^18.1.0","size-limit":"^7.0.8","typescript":"^4.6.4"},"size-limit":[{"path":"esm/index.js","limit":"3 KB"}],"licenseText":"MIT License\n\nCopyright (c) 2022 Soumyajit Pathak\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-clamp-text@1.1.1","dist":{"shasum":"6cf5a47a12dd1c276bb053660dc5c27719d048b6","integrity":"sha512-hgzZPn4RmbgqzD/AGLkDtV+Lk+Ab8Ecdq7Gc87wY/qb7UiyBDMEhzLIGFNf4A7yPS7FCdoDILv/Dp8vRwT+beQ==","tarball":"https://registry.npmjs.org/use-clamp-text/-/use-clamp-text-1.1.1.tgz","fileCount":13,"unpackedSize":21938,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGJmISeYJYqqNp9GpzZFBXRkQgogF6SuSQ/qQlR5Ix5uAiEA8vc3dNKf/QoqZgou3dIw6k30OpWZe6w6jKjU7R3pV4Q="}]},"_npmUser":{"name":"drenther","email":"s.pathak5995@gmail.com"},"directories":{},"maintainers":[{"name":"drenther","email":"s.pathak5995@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-clamp-text_1.1.1_1715256069171_0.8232130367295065"},"_hasShrinkwrap":false}},"time":{"created":"2022-04-29T13:18:16.054Z","1.0.0":"2022-04-29T13:18:16.231Z","modified":"2024-05-09T12:01:09.610Z","1.0.1":"2022-05-02T11:23:17.669Z","1.1.0":"2022-05-02T13:34:41.478Z","1.1.1":"2024-05-09T12:01:09.406Z"},"maintainers":[{"name":"drenther","email":"s.pathak5995@gmail.com"}],"description":"react hook to clamp multiline text to a given height in a responsive way (in < 2.5kb)","homepage":"https://github.com/drenther/use-clamp-text#readme","keywords":["react","react-hook","hook","clamp","text","clamp-text","multiline","responsive"],"repository":{"type":"git","url":"git+ssh://git@github.com/drenther/use-clamp-text.git"},"author":{"name":"Soumyajit Pathak"},"license":"MIT","readme":"# use-clamp-text\n\n![Bundle Size](https://badgen.net/bundlephobia/minzip/use-clamp-text) ![npm version](https://badgen.net/npm/v/use-clamp-text) ![npm downloads](https://img.shields.io/npm/dw/use-clamp-text) ![types](https://badgen.net/npm/types/use-clamp-text) ![visitor badge](https://visitor-badge.glitch.me/badge?page_id=use-clamp-text)\n\nreact hook to clamp multiline text to a given height in a responsive way and with extreme flexibility _(under 2.5kb)_\n\n[Line Clampin’ (Truncating Multiple Line Text)](https://css-tricks.com/line-clampin/) is a major hassle still for most browsers.\n\nThis tiny react hook eases that pain.\n\n## Why hook?\n\nCause it gives extreme flexibility over how you want to control the text. Do you want truncate it or not? When to truncate it? How to show read more interactions? and more...\n\n## Usage\n\n### Basic Example\n\n```js\nimport { useClampText } from 'use-clamp-text';\n\nconst longText = \"Spicy jalapeno bacon ipsum dolor amet drumstick sirloin chuck shankle. Flank ribeye pancetta andouille ham hock. Turkey cow tenderloin landjaeger filet mignon hamburger. Pig tail strip steak pastrami t-bone venison bresaola biltong corned beef drumstick pork hamburger tri-tip. Tongue ham hock corned beef tri-tip meatball t-bone fatback andouille sirloin chuck jowl biltong pastrami. Ham hock ground round landjaeger tail strip steak. Ham sirloin pork loin salami spare ribs. Jerky cow short ribs ground round. Hamburger porchetta shankle meatloaf shank.\";\n\nfunction ClampedText {\nconst [ref, { noClamp, clampedText }] = useClampText({\n  text: longText,\n});\n\n  return (\n    <section>\n      <h1>\n        {noClamp ? 'Not truncated' : 'Truncated'}\n      </h1>\n      <div ref={ref}>\n        {clampedText}\n      </div>\n    </section>\n  );\n}\n```\n\n### Advanced Example\n\n[Check out the codesandbox example](https://codesandbox.io/s/xenodochial-hoover-ty3u49?file=/src/App.js)\n\n## API Reference\n\n### Arguments\n\nThe hook accepts only a single object argument is accepted with the following properties:\n\n| property  | type               | required | default | description                                                                                                                                                        |\n| --------- | ------------------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| text      | `string`           | `true`   |         | Text you wish to clamp                                                                                                                                             |\n| ellipsis  | `string \\| number` | `false`  | `'…'`   | String displayed after the clamped text or number of characters to be trimmed off the string (useful for adding inline custom ellipsis like a `<a>` or `<button>`) |\n| expanded  | `boolean`          | `false`  | `false` | To control whether the string should be truncated or not                                                                                                           |\n| lines     | `number`           | `false`  | `3`     | Number of visible lines                                                                                                                                            |\n| debounce  | `number`           | `false`  | `300`   | Time in milliseconds used for debounce                                                                                                                             |\n| charWidth | `number`           | `false`  | `1.2`   | Character width to be assumed for calculating clamped string length (an average depending on your font size should work well enough)                               |\n\n### Return\n\nThe hook returns a tuple -\n\n- [0] (first element) - `React.MutableRefObject<HTMLElement | null>` - a ref to attach to the element where the clamped text will be rendered\n- [1] (second element) - `Object` - The properties of the object are documented in the table below\n\n| property    | type      | description                                                                                                            |\n| ----------- | --------- | ---------------------------------------------------------------------------------------------------------------------- |\n| noClamp     | `boolean` | Whether the text is clamped or not. Will return true if not clamped                                                    |\n| clampedText | `string`  | The string to be rendered                                                                                              |\n| key         | `string`  | A key to attach to the element that contains the string to be rendered (only needed when using custom inline ellipsis) |\n\n## Prior Art (packages I ~~copied~~ adapted code from)\n\n- [`react-clamp-lines`](https://github.com/zoltantothcom/react-clamp-lines)\n- [`nanoclamp`](https://github.com/microlinkhq/nanoclamp)\n","readmeFilename":"README.md"}