Skip to content

sherwinshen/vue3-text-clamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

logo

Vue3 Text-Clamp

Vue3 component which allows you to ellipsis your multiline text, see more ๐Ÿ‘‰ homepage.

Features

  • Clamps text with max lines and/or max height. No need to specify line height.
  • Place elllipsis at the end/middle/start of the clamped text and customize elllipsis string.
  • Automatically updates upon layout change.
  • The clamped text can be expanded/collapsed.
  • Customizable and responsive content before/after clamped text.

Install and Usage

$ npm install --save vue3-text-clamp

โ†“ Full import

import { createApp } from 'vue';
import TextClamp from 'vue3-text-clamp';
import App from './App.vue';

createApp(App).use(TextClamp).mount('#app');

โ†“ Manually import

<template>
  <text-clamp text='hello world' :max-lines='2' />
</template>

<script lang='ts' setup>
import TextClamp from 'vue3-text-clamp';
</script>

Links

License

MIT License (MIT). Please see License File for more information.

About

๐Ÿ“„ Vue3 component which allows you to ellipsis your multiline text

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published