npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

spino-elements

v1.5.2

Published

A Vue.js 2 component library for dynamically adjusting text sizes within elements using TextFit.

Readme

spino-elements

A Vue.js 2 component library for dynamically adjusting text sizes within elements using TextFit. Includes components for managing text fitting and setting text width limits.

Installation

To install the library, run the following command in your Vue 2 project:

npm install spino-elements

Usage TextfitManager

In your template, use the TextfitManager component. You can register it in App.vue and use it globally.

import { TextfitManager } from "spino-elements";

export default {
  components: {
    TextfitManager,
  },
  data() {
    return {
      isMobile: false, // Adjust based on device type
    };
  },
};

TextfitManager Example Usage

In your template, use the TextfitManager component:

<TextfitManager
  :i_ElementToTextfit="['textfit-subtitle-1', 'textfit-title']"
  :i_SameSizeElements="['textfit-title']"
  :i_ResizeStopOn="modalIsVisible"
  :i_Component="'BuyFeature'"
  :isMobile="isMobile"
/>

Props TextfitManager

  • i_ElementToTextfit: Array of class names of elements that should be text-fitted.
  • i_SameSizeElements: Array of class names that should have the same font size.
  • i_PrioritizeElement: String of a class name to prioritize the font size of the other elements.
  • i_ResizeStopOn: Boolean flag to stop resizing when the condition is met.
  • i_Component: String identifier for the component.
  • isMobile: Boolean to define if the device is mobile.

Usage TextfitLimiter

In all places where you want to fit text elements dynamically, use the TextfitLimiter component instead with the following implementation.

import { TextfitLimiter } from "spino-elements";

export default {
  components: {
    TextfitLimiter,
  },
  data() {
    return {};
  },
};

TextfitLimiter Example Usage

In your template, use the TextfitManager component:

<TextfitLimiter
  :i_Class="'custom-class'"
  :i_Text="'Sample Text'"
  :config="{ minCharWidth: 2, maxCharWidth: 40, minPercentage: 70, maxPercentage: 90 }"
  :i_isReactiveFix="true"
  :i_isBreakLine="false"
/>

Props TextfitLimiter

  • i_Class: String — Optional. Specifies a CSS class name that will be applied to the component, allowing for custom styling.

  • i_Text: String — Optional. Defines the text content to be displayed within the component.

  • config: Object — Required. Sets configuration parameters for text fitting within the component. The default configuration is:

    {
      minCharWidth: 1,
      maxCharWidth: 50,
      minPercentage: 65,
      maxPercentage: 85
    }
  • i_isReactiveFix: Boolean — Optional (default: false). If set to true, enables a reactive fix to adjust text dynamically when data changes.

  • i_isBreakLine: Boolean — Optional (default: false). If set to true, allows text to break into multiple lines if needed.

Notes

  • Ensure the parent container has a defined width to properly fit the text.
  • The config prop allows customization of text scaling behavior.
  • If i_isBreakLine is false, the text will try to fit within a single line.
  • If i_isReactiveFix is true, text will automatically adjust when content changes.

Development

To contribute or make changes:

  1. Clone the repository:

    git clone https://github.com/ronbSpino/TextFit.git
  2. Install dependencies:

    npm install
  3. Run the build process:

    npm run build
  4. Make your changes and test them.

License

MIT License. See the LICENSE file for more details.