🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

@b-design/ui-truncate

Package Overview
Dependencies
Maintainers
8
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@b-design/ui-truncate

React component for Alibaba Cloud.

latest
npmnpm
Version
0.0.1
Version published
Maintainers
8
Created
Source

@b-design/ui-truncate

用于截断超长文本。

基本用法

单行截断

比较常见的使用方式: $XView

根据容器的宽度自动截断: $XView

在宽度截断模式下,可以截断任何可渲染元素,不只是 string: $XView

可以自定义省略符号。不过注意,如果省略符号不是...的话,会在宽度截断模式下造成“字符在中间被截断”(在浏览器中没办法支持那么“智能”的截断): $XView

每当 children 变化的时候,Truncate 会自动检查是否需要截断: $XView

可以自定义 tootip 的 max-width: $XView

设置 tooltip 样式: $XView

多行截断

$XView

想要做多行截断的时候,先考虑能否通过普通的滚动来让用户浏览全部内容。从用户体验的角度来看,后者的体验更好,无需使用多行截断。

APIs

单行截断:

$XView

多行截断:

$XView

Keywords

b-design

FAQs

Package last updated on 05 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts