1.0.1 • Published 12 months ago

vue-squish-fit-text v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

vue-squish-fit-text

Introduction

A port of sc-fitted-text to a Vue 3 Component.

Motivation

Broadcast graphics often need to ensure that text will fit within a given space. There are existing libraries out there that can reduce the font size of an element to fit a given space, but this behavior isn't always what is wanted. Sometimes, the design calls for horizontally squishing (scaling) the text, rather than reducing the font size. This element enables that.

Installation

npm install vue-squish-fit-text

and then register it either globally:

import { createApp } from "vue";
import "./style.css";
import App from "./App.vue";
import VueSquishFitText from "vue-squish-fit-text";

createApp(App).component("vue-squish-fit-text", VueSquishFitText).mount("#app");

or locally:

<script setup lang="ts">
import VueSquishFitText from "vue-squish-fit-text";
</script>

<template>
   <vue-squish-fit-text text="This text will be fitted." :maxWidth="250" align="left" />
</template>

Properties

Property nameValue type acceptedDefault
textstringNone
maxWidthnumber0
alignleft, center or rightleft
1.0.1

12 months ago

1.0.0

12 months ago