@miii/vue-lettering

Web typography tool for Vue to split text into pieces for CSS selection with ease.
630 10
Install
npm install @miii/vue-lettering
Latest Version:1.1.3
Vue:2
License:MIT
Last Updated:Dec 12, 2022
Links: GitHub  ·  npm
Maintainer: miii

@miii/vue-lettering
tests docs NPM badge Minified size

Web typography tool for Vue to split text into pieces for CSS selection with ease.

The plugin adds a v-lettering directive which can be used to create groups of (individual) letters using span or tag of your choice.

Inspired by Lettering.js.

🚀 Features

  • Typescript ready
  • SSR ready
  • Supports nested splits
  • Nuxt module included

📦 Install

$ yarn add @miii/vue-lettering

Add to your app:

import Vue from 'vue'
import VueLettering from '@miii/vue-lettering'

Vue.use(VueLettering, {
  // Optional plugin options
})

const app = new Vue({
  // ...
})

🚀 Usage

In your template:

<h1 v-lettering>Foo</h1>

Rendered output:

<h1 aria-label="Foo">
  <span class="vl__g vl--i-1" aria-hidden="true">F</span>
  <span class="vl__g vl--i-2" aria-hidden="true">o</span>
  <span class="vl__g vl--i-3" aria-hidden="true">o</span>
</h1>

Read the full documentation here.

🔉 Accessibility

This plugin uses the WAI-ARIA guidelines on the injected elements to make them accessibile to users with screenreaders.

❗️ Issues

If you have any feedback or suggestions, please feel free to write an issue or PR.

Related Packages

nuxt-electron

Nuxt Integration with Electron

38,592 229
nuxt-simple-line-icons

Nuxt module to add simple-line-icons

872 5
@sparing-software/v-clamp

Vue directive plugin for text truncate

3,655 15
nuxt-unleash

Nuxt.js module to use Unleash toggle feature services

1,442 21

Version History

Version Released Vue License
1.1.3 ^2.6.11 MIT
1.1.1 ^2.6.11 MIT
1.1.0 ^2.6.11 MIT
1.0.3 ^2.6.11 MIT
Pre-releases (4)
Version Released Vue License
1.1.3-alpha.3 ^2.6.11 MIT
1.1.3-alpha.2 ^2.6.11 MIT
1.1.3-alpha.1 ^2.6.11 MIT
1.1.3-alpha.0 ^2.6.11 MIT