
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
@b-design/ui-truncate
Advanced tools
用于截断超长文本。
比较常见的使用方式: $XView
根据容器的宽度自动截断: $XView
在宽度截断模式下,可以截断任何可渲染元素,不只是 string: $XView
可以自定义省略符号。不过注意,如果省略符号不是...的话,会在宽度截断模式下造成“字符在中间被截断”(在浏览器中没办法支持那么“智能”的截断):
$XView
每当 children 变化的时候,Truncate 会自动检查是否需要截断: $XView
可以自定义 tootip 的 max-width: $XView
设置 tooltip 样式: $XView
想要做多行截断的时候,先考虑能否通过普通的滚动来让用户浏览全部内容。从用户体验的角度来看,后者的体验更好,无需使用多行截断。
单行截断:
多行截断:
FAQs
React component for Alibaba Cloud.
We found that @b-design/ui-truncate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.