A reusable Vue 3 component that provides text truncation with "Show more"/"Show less" functionality and an optional tooltip. Includes the ShowMore and Tooltip components for flexible usage in your Vue 3 applications.
www.npmjs.com/package/showmore-vue/access
npm install showmore-vueimport { createApp } from 'vue';
import App from './App.vue';
import { ShowMore } from 'showmore-vue';
const app = createApp(App);
app.component('ShowMore', ShowMore);
app.mount('#app');- Truncate long text and expand/collapse with custom button labels
- Optional tooltip for additional information
- Customizable styles for buttons and tooltip
length: Number of characters to show before truncationshowMoreEnabled: Show the "Show more" buttonshowMoreText: Custom label for the expand buttonshowLessEnabled: Show the "Show less" button after expansionshowLessText: Custom label for the collapse buttonshowMoreBtnStyle: Style object for the buttonsshowTooltip: Enable tooltip on hovertooltipHeader: Header text for the tooltiptooltipColor: Color for the tooltip
See the demo/App.vue file for a full example of usage and available props.
