label-more
Element with Text shows a "More" or "Less" button to expand / minimize the text.
With this Element the max-height for the text can be defined. If the text overflows the available area, the text will be truncated and a "More"-Button will be visible. If the user clicks the "More"-Button the area expands and the whole text is visible.
Sample code
LabelMore labelMore = new LabelMore(); labelMore.setContentHeight("60"); labelMore.setHtml("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."); add(new H3("Example with contentHeight 60 and overflowed text")); add(labelMore);
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
- Released
- 2019-09-19
- Maturity
- EXPERIMENTAL
- License
- BSD 3-clause "New" or "Revised" License
Compatibility
- Framework
- Vaadin 14+
- Browser
- N/A
label-more - Vaadin Add-on Directory
Element with Text shows a "More" or "Less" button to expand / minimize the text.With this Element the max-height for the text can be defined. If the text overflows the available area, the text will be truncated and a "More"-Button will be visible. If the user clicks the "More"-Button the area expands and the whole text is visible.
View on GitHub