All Projects → mobilusoss → react-ellipsis-text

mobilusoss / react-ellipsis-text

Licence: MIT License
React text ellipsify component

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to react-ellipsis-text

ngx-admin-yzz
angular组件demo
Stars: ✭ 13 (-53.57%)
Mutual labels:  tooltip
van11y-accessible-simple-tooltip-aria
ES2015 accessible simple tooltip, using ARIA
Stars: ✭ 22 (-21.43%)
Mutual labels:  tooltip
SpikeTip
Create effortless tooltips that breathe CSS! No Javascript. Just the good old CSS.
Stars: ✭ 26 (-7.14%)
Mutual labels:  tooltip
ToolTipPopupWordTV
ToolTipopupWordTV is an Open Source Android library that allows developers to easily open a popup with details by select a word from a textview.
Stars: ✭ 41 (+46.43%)
Mutual labels:  tooltip
tooltip
[DEPRECATED] The tooltip that has all the right moves
Stars: ✭ 133 (+375%)
Mutual labels:  tooltip
Zebra Tooltips
A lightweight, accessible, and highly configurable jQuery plugin for creating beautiful tooltips
Stars: ✭ 52 (+85.71%)
Mutual labels:  tooltip
super-simple-css-tooltips
Super simple tooltips
Stars: ✭ 26 (-7.14%)
Mutual labels:  tooltip
Codist
A visual studio extension which enhances syntax highlighting, quick info (tooltip), navigation bar, scrollbar, display quality and brings smart tool bar to code editor.
Stars: ✭ 134 (+378.57%)
Mutual labels:  tooltip
ng2-tooltip-directive
The tooltip is a pop-up tip that appears when you hover over an item or click on it.
Stars: ✭ 101 (+260.71%)
Mutual labels:  tooltip
jquery-accessible-dialog-tooltip-aria
jQuery simple and accessible dialog tooltip window, using ARIA
Stars: ✭ 17 (-39.29%)
Mutual labels:  tooltip
floating-ui
A low-level toolkit to create floating elements. Tooltips, popovers, dropdowns, and more
Stars: ✭ 23,485 (+83775%)
Mutual labels:  tooltip
raiderio-addon
RaiderIO AddOn
Stars: ✭ 35 (+25%)
Mutual labels:  tooltip
Inspecio
A Minecraft mod which adds more tooltip components to items.
Stars: ✭ 87 (+210.71%)
Mutual labels:  tooltip
idTip
WoW Addon: Adds IDs to the ingame tooltips
Stars: ✭ 38 (+35.71%)
Mutual labels:  tooltip
SwiftUI-Tooltip
Easy Tooltip for your SwiftUI Project
Stars: ✭ 130 (+364.29%)
Mutual labels:  tooltip
smart-webcomponents-community
Material & Bootstrap Web Components built with Smart
Stars: ✭ 30 (+7.14%)
Mutual labels:  tooltip
github-annotator
Show user, repo and gist info in a tooltip on Github news feed - Chrome extension
Stars: ✭ 13 (-53.57%)
Mutual labels:  tooltip
ak-vue3
组件库包含了 AutoForm 自动表单、BackTop 返回顶部、Breadcrumb 面包屑、 Button 按钮、Cascader 级联选择器、Checkbox 多选框、Collapse 折叠面板、ColorPicker 颜色选择器、DataPicker 时间选择器、Dialog 弹层对话框、Alert 弹框、Echarts 图形图表、Form 表单、Input 输入框、Lazy 图片延时加载、Loading 加载等待、Menu 菜单、Pagination 分页、Progress 进度条、Radio 单选框、Select 选择器、Steps 步骤条、Swiper 图片轮播、Switch 开关、Table 表格、Tabs 标签页、Textarea 文本框、Tooltip 提示、Tr…
Stars: ✭ 24 (-14.29%)
Mutual labels:  tooltip
hexo-tag-hint
A Hexo tag plugin to display text hint/spoiler tooltip.
Stars: ✭ 26 (-7.14%)
Mutual labels:  tooltip
flowtip
A flexible, adaptable and easy to use tooltip positioning library.
Stars: ✭ 16 (-42.86%)
Mutual labels:  tooltip

react-ellipsis-text Build Status npm version codebeat badge FOSSA Status codecov

NPM

Demo

View Demo

Installation

npm install --save react-ellipsis-text

API

EllipsisText

Props

EllipsisText.propTypes = {
  text: PropTypes.string.isRequired,
  length: PropTypes.number.isRequired,
  tail: PropTypes.string,
  tailClassName: PropTypes.string,
  tooltip: PropTypes.shape({
    copyOnClick: PropTypes.bool,
    onAppear: PropTypes.func,
    onDisapepear: PropTypes.func
  })
};
  • text: Text to display

  • length: Max length of text

  • tail: Trailing string (Default '...')

  • tailClassName: Trailing string element's class name

  • tooltip: Tooltip will be display when supplied

  • tooltip.clipboard: Original text will be copied into clipboard when tooltip is clicked.

  • tooltip.onAppear: Called when tooltip is shown.

  • tooltip.onDisapepear: Called when tooltip is hidden.

Usage example

"use strict";

import React from "react";
import EllipsisText from "react-ellipsis-text";

//allow react dev tools work
window.React = React;

class App extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <div>
        <EllipsisText text={"1234567890"} length={"5"} />
      </div>
    );
  }
}

React.render(<App />, document.getElementById("out"));

// It will be
// <div>
//   <span><span>12</sapn><span class='more'>...</span></span>
//  </div>
//

See example

npm install
npm run start:example

Tests

npm run test:local

License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].