-
-
Notifications
You must be signed in to change notification settings - Fork 16
Allow Partial Customization Without Losing Built-in Features #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@EranAAA Regarding the “copy to clipboard” feature, it can already be customized by modifying the onClick method of the Copied component. <Copied
render={({ 'data-copied': copied, style, onClick, ...props }, { value }) => {
const styl = { whiteSpace: 'nowrap' }
if (copied) {
return <span style={{ ...style, ...styl }}>复制成功</span>
}
return <span style={{ ...style, ...styl }} onClick={onClick}>复制</span>
}}
/> Regarding "Text shortening (ellipsis)", if you want to customize the display of the ellipsis (...), I can provide a props to configure it, similar to the example below: <JsonView stringEllipsis="..." /> react-json-view/core/src/types/index.tsx Lines 82 to 84 in 725c4ce
|
I will try the Copied 🙏 also i will appreciate an update about the ellipsis. |
I’ve released v2.0.0-alpha.31 and added a <JsonView stringEllipsis="..." /> |
Amazing 🤩 |
Hi, thanks for the great work on @uiw/react-json-view!
When customizing the component in v2, important features like:
• Text shortening (ellipsis)
• Expand/collapse for long values
• Copy-to-clipboard
are lost because internal components like StringView or CopyIcon are not exposed.
Feature Request:
Please consider exposing internal components or providing a way to extend rendering without losing the default behavior.
This would allow simple customizations (e.g., styling a specific key) without re-implementing core logic.
Thanks again!
The text was updated successfully, but these errors were encountered: