All Projects → JayeshLab → vue-resize-text

JayeshLab / vue-resize-text

Licence: MIT License
A vue directive which automatically resize font size based on element width.

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects
HTML
75241 projects

Projects that are alternatives of or similar to vue-resize-text

Fitty
✨ Makes text fit perfectly
Stars: ✭ 3,321 (+5009.23%)
Mutual labels:  resize, responsive, text
vue-responsive-text
↔ Vue component that scales its child node in relation to its parent node's width
Stars: ✭ 23 (-64.62%)
Mutual labels:  resize, responsive, text
Sketch Textbox Fit Content
Set the height of a selected text layer or all text layers in a selected group to it's content's height.
Stars: ✭ 49 (-24.62%)
Mutual labels:  resize, text
pygame-text-input
a small module that enables you to input text with your keyboard using pygame
Stars: ✭ 114 (+75.38%)
Mutual labels:  font, text
glfont
A modern opengl text rending library for Golang
Stars: ✭ 27 (-58.46%)
Mutual labels:  font, text
Cirrus
☁️ The CSS framework for the modern web.
Stars: ✭ 716 (+1001.54%)
Mutual labels:  font, responsive
Image Map Resizer
Responsive HTML Image Maps
Stars: ✭ 661 (+916.92%)
Mutual labels:  resize, responsive
Google Type
Collaborative typography project using select passages from Aesop's Fables set to Google Fonts
Stars: ✭ 971 (+1393.85%)
Mutual labels:  font, responsive
Wgpu glyph
A fast text renderer for wgpu (https://github.com/gfx-rs/wgpu)
Stars: ✭ 159 (+144.62%)
Mutual labels:  font, text
Typogenic
Signed-distance field text rendering for Unity
Stars: ✭ 183 (+181.54%)
Mutual labels:  font, text
multiple-windows
This project is a chrome extension. It provide to create windows to different sizes and multiple for front-end developers.
Stars: ✭ 16 (-75.38%)
Mutual labels:  resize, responsive
Zfont
💬 Text plugin for Zdog - works with any .ttf font!
Stars: ✭ 126 (+93.85%)
Mutual labels:  font, text
hotscript
HotScript - Revolutionizing how Windows works.
Stars: ✭ 29 (-55.38%)
Mutual labels:  resize, text
baseline
New method for creating leading on the web
Stars: ✭ 31 (-52.31%)
Mutual labels:  font, text
react-quiz-app
A Simple React Quiz App 💎
Stars: ✭ 37 (-43.08%)
Mutual labels:  responsive
craft-text-detector
Packaged, Pytorch-based, easy to use, cross-platform version of the CRAFT text detector
Stars: ✭ 151 (+132.31%)
Mutual labels:  text
nglp-angular-material-landing-page
NGLP is an Angular Material Landing Page.
Stars: ✭ 32 (-50.77%)
Mutual labels:  responsive
gridsome-starter-liebling
Gridsome starter based on the Liebling theme for Ghost. Content is added via markdown, while Tailwind CSS is used for the layout/styling.
Stars: ✭ 21 (-67.69%)
Mutual labels:  responsive
awrora-starter
Landing page template built with one of most popular javascript library Vue.JS, Vuetify (Material Design) and Nuxt.JS with SSR.
Stars: ✭ 38 (-41.54%)
Mutual labels:  responsive
jekyll-grid
Jekyll theme (used on 25x52.com) displays posts in a grid. Ideal for projects
Stars: ✭ 63 (-3.08%)
Mutual labels:  responsive

Vue Resize Text

A vue directive which automatically resize font size based on element width.

It makes the font-size flexible on fluid or responsive layout.

npm npm Build Status npm

Live Demo: Resize the browser viewport to see the effect in action

For Vue.js 3.x see the vue3-resize-text

vue-resize-text

Installation

Install via NPM

$ npm install vue-resize-text --save

Install via CDN

<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-resize-text"></script>

Global

Register VueResizeText globally:

import Vue from 'Vue';
import VueResizeText from 'vue-resize-text';

Vue.use(VueResizeText)

Directive v-resize-text then can be used in any of Component

<template>
  <div v-resize-text>Hello Vue</div>
</template>

Local

Include the VueResizeText directive directly into your component using import:

<template>
  <div v-resize-text>Hello Vue</div>
</template>
<script>
import ResizeText from 'vue-resize-text'
export default {
 directives: {
    ResizeText
 }
}
</script>

Usage

Basic usage

<template>
  <div>
    <div v-resize-text="{ratio:1.3, minFontSize: '30px', maxFontSize: '100px', delay: 200}">Hello Vue</div>
  </div>
</template>

<script>
  import ResizeText from 'vue-resize-text'
  export default {
    directives: {
        ResizeText
     }
  };
</script>

Directive Arguments

v-resize-text="{ratio:1.5, minFontSize: '30px', maxFontSize: '100px', delay: 200}"

Argument Description Type Default
ratio Font Ratio is the tweek to make the text resize properly, greater then 1 makes the font smaller and less then 1 make the font bigger Number 1
minFontSize Minimum font-size threshold in px Number/String 16px or 16
maxFontSize Maximum font-size threshold in px Number/String 500px or 500
delay Debound time delay on window resize Number 200

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].