{"id":23046445,"url":"https://github.com/mobilusoss/react-ellipsis-text","last_synced_at":"2025-08-15T00:33:19.574Z","repository":{"id":1766522,"uuid":"44312356","full_name":"mobilusoss/react-ellipsis-text","owner":"mobilusoss","description":"React text ellipsify component","archived":false,"fork":false,"pushed_at":"2023-01-03T23:26:57.000Z","size":2347,"stargazers_count":30,"open_issues_count":7,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-14T22:17:53.015Z","etag":null,"topics":["react","tooltip"],"latest_commit_sha":null,"homepage":"http://mobilusoss.github.io/react-ellipsis-text","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/mobilusoss.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}},"created_at":"2015-10-15T11:13:23.000Z","updated_at":"2024-03-16T01:43:55.000Z","dependencies_parsed_at":"2023-01-11T16:05:50.257Z","dependency_job_id":null,"html_url":"https://github.com/mobilusoss/react-ellipsis-text","commit_stats":null,"previous_names":["georgeosddev/react-ellipsis-text"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobilusoss%2Freact-ellipsis-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobilusoss%2Freact-ellipsis-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobilusoss%2Freact-ellipsis-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobilusoss%2Freact-ellipsis-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mobilusoss","download_url":"https://codeload.github.com/mobilusoss/react-ellipsis-text/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229883089,"owners_count":18138935,"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":["react","tooltip"],"created_at":"2024-12-15T22:24:35.425Z","updated_at":"2024-12-15T22:24:41.035Z","avatar_url":"https://github.com/mobilusoss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-ellipsis-text [![Build Status](https://travis-ci.org/mobilusoss/react-ellipsis-text.svg?branch=master)](https://travis-ci.org/mobilusoss/react-ellipsis-text) [![npm version](https://badge.fury.io/js/react-ellipsis-text.svg)](http://badge.fury.io/js/react-ellipsis-text) [![codebeat badge](https://codebeat.co/badges/8fcdee06-9bfd-437e-aa17-cbe335a28ac9)](https://codebeat.co/projects/github-com-mobilusoss-react-ellipsis-text-master) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmobilusoss%2Freact-ellipsis-text.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmobilusoss%2Freact-ellipsis-text?ref=badge_shield) [![codecov](https://codecov.io/gh/mobilusoss/react-ellipsis-text/branch/master/graph/badge.svg)](https://codecov.io/gh/mobilusoss/react-ellipsis-text)\n\n\n[![NPM](https://nodei.co/npm/react-ellipsis-text.png)](https://nodei.co/npm/react-ellipsis-text/)\n\n## Demo\n\n[View Demo](http://mobilusoss.github.io/react-ellipsis-text/example/)\n\n## Installation\n\n```bash\nnpm install --save react-ellipsis-text\n```\n\n## API\n\n### `EllipsisText`\n\n#### Props\n\n```javascript\nEllipsisText.propTypes = {\n  text: PropTypes.string.isRequired,\n  length: PropTypes.number.isRequired,\n  tail: PropTypes.string,\n  tailClassName: PropTypes.string,\n  tooltip: PropTypes.shape({\n    copyOnClick: PropTypes.bool,\n    onAppear: PropTypes.func,\n    onDisapepear: PropTypes.func\n  })\n};\n```\n\n- `text`: Text to display\n\n- `length`: Max length of text\n\n- `tail`: Trailing string (Default '...')\n\n- `tailClassName`: Trailing string element's class name\n\n- `tooltip`: Tooltip will be display when supplied\n\n- `tooltip.clipboard`: Original text will be copied into clipboard when tooltip is clicked.\n\n- `tooltip.onAppear`: Called when tooltip is shown.\n\n- `tooltip.onDisapepear`: Called when tooltip is hidden.\n\n## Usage example\n\n```javascript\n\"use strict\";\n\nimport React from \"react\";\nimport EllipsisText from \"react-ellipsis-text\";\n\n//allow react dev tools work\nwindow.React = React;\n\nclass App extends React.Component {\n  constructor(props) {\n    super(props);\n  }\n\n  render() {\n    return (\n      \u003cdiv\u003e\n        \u003cEllipsisText text={\"1234567890\"} length={\"5\"} /\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n\nReact.render(\u003cApp /\u003e, document.getElementById(\"out\"));\n\n// It will be\n// \u003cdiv\u003e\n//   \u003cspan\u003e\u003cspan\u003e12\u003c/sapn\u003e\u003cspan class='more'\u003e...\u003c/span\u003e\u003c/span\u003e\n//  \u003c/div\u003e\n//\n```\n\nSee [example](https://github.com/mobilusoss/react-ellipsis-text/tree/develop/example)\n\n```bash\nnpm install\nnpm run start:example\n```\n\n## Tests\n\n```bash\nnpm run test:local\n```\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmobilusoss%2Freact-ellipsis-text.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmobilusoss%2Freact-ellipsis-text?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobilusoss%2Freact-ellipsis-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobilusoss%2Freact-ellipsis-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobilusoss%2Freact-ellipsis-text/lists"}