feat(design): support component contentProps and css ellipsis for Descriptions - #1591
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dengfuping
force-pushed
the
feat/descriptions-css-ellipsis
branch
from
September 24, 2026 06:20
419a419 to
d28fef5
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

📦 Modified package
🤔 This is a ...
🔗 Related issue link
N/A
💡 Background and solution
Background
In borderless mode, every Descriptions item content is wrapped with
Typography.Textto auto-ellipsis long text and show aTooltip. On pages with many items (detail panels with dozens of fields), that means each item pays for Typography's overflow measuring and Tooltip, even when the text is short and the measurement is never needed. There was also no way to configure content props for all items at once:contentPropshad to be repeated on every item.Solution
Descriptionsgains a component-levelcontentProps, applied to all items and overridable by each item's owncontentProps.contentProps.ellipsisaccepts a new'css'value: a lightweight mode that uses pure CSS single-line truncation plus the nativetitleattribute instead of Typography, so no overflow measuring and no Tooltip are created. Thetitleis taken from an explicitcontentProps.titlefirst, and falls back to string children; structured children are skipped since the native attribute only accepts plain text.copyableandeditablerely on Typography's inline action buttons, which would be clipped by the CSS truncation container, an item that enables either of them falls back to the full Typography mode (identical toellipsis: true), so the buttons and Tooltip keep working.contentPropsis now typed as the exportedDescriptionsContentProps(Omit<TextProps, 'ellipsis'> & { ellipsis?: Ellipsis | 'css' }).Usage
Nothing changes for the default
ellipsis: truebehavior, so existing usages are unaffected.Typography.Text, paying for overflow measuring and Tooltip📝 Changelog
- 🆕 In borderless mode, support component-level
contentPropsto set content props for all items at once, overridable by each item'scontentProps.- 🆕 In borderless mode,
contentProps.ellipsissupports the'css'lightweight mode: pure CSS single-line truncation + nativetitle(auto-derived from string children), without Typography's overflow measuring andTooltip. Ideal for descriptions with many items. An item that enablescopyableoreditablefalls back to the full mode, so its inline action buttons andTooltipkeep working.- ⭐️ New exported type
DescriptionsContentPropsforcontentProps.- 🆕 无边框模式下,新增组件级
contentProps,可统一设置所有描述项的内容属性,单项contentProps可覆盖。- 🆕 无边框模式下,
contentProps.ellipsis支持'css'轻量模式:纯 CSS 单行截断 + 原生title(字符串内容自动派生),不产生 Typography 的溢出测量和Tooltip开销,适合描述项数量多的场景。单项开启copyable或editable时回退为完整模式,内联操作按钮和Tooltip均可正常使用。- ⭐️ 新增导出类型
DescriptionsContentProps,用于contentProps。☑️ Self-Check before Merge