@svackages/truncate
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

svackage logo

npm version license

Truncate Action

An easy action to truncate multiline text in an element with fixed height.

  • fully typed
  • add your own symbol at the end
  • updates on resize

Install: npm install @svackages/truncate

<script>
    import truncate from "@svackages/truncate";
</script>
<p
    use:truncate>
    Some very long text that needs to be shorter 🩳.
</p>
<p
    use:truncate={' (read more)'}>
    Use your own symbol that should be displayed at the end of your truncation
</p>

REPL

https://svelte.dev/repl/0f18e3915e334214a61a84fd2dbd8bda?version=3.44.2

Readme

Keywords

none

Package Sidebar

Install

npm i @svackages/truncate

Weekly Downloads

10

Version

1.0.0

License

MIT

Unpacked Size

4.29 kB

Total Files

5

Last publish

Collaborators

  • d.reitzner