A Reusable Tooltip Component for Vue

Vue-Custom-Tooltip

A customizable, reusable, and reactive tooltip component for Vue (and VuePress) projects.

Tooltip Vue component examples

Installation

# With npm
npm install @adamdehaven/vue-custom-tooltip

# or Yarn
yarn add @adamdehaven/vue-custom-tooltip

Vue.js (Global Install)

It is recommended to install the plugin in your Vue project’s entry file. For projects created with @vue/cli, this is likely your main.js file where you are already importing Vue.

// main.js (or your Vue entry file)

// Import Vue... you're probably already doing this
import Vue from 'vue'

// Import the tooltip component before calling 'new Vue()'
import VueCustomTooltip from '@adamdehaven/vue-custom-tooltip'

// Install the plugin using ONE of the options below:
// --------------------------------------------------

// 1\. Install with default options
Vue.use(VueCustomTooltip)

// ===== OR  =====

// 2\. Install with custom options (defaults shown)
Vue.use(VueCustomTooltip, {
  name: 'VueCustomTooltip',
  color: '#fff',
  background: '#000',
  borderRadius: 12,
  fontWeight: 400,
})

VuePress (Global Install)

VuePress Standalone Plugin

I have released a standalone VuePress plugin that wraps this component into an actual VuePress Plugin installable through the .vuepress/config.js or .vuepress/theme/index.js file. If you’d rather use the standalone plugin in your VuePress project, head over to the vuepress-plugin-custom-tooltip repository.

For VuePress projects, the theme/enhanceApp.js is a good location to initialize plugins.

// theme/enhanceApp.js

// Import Vue... you're probably already doing this
import Vue from 'vue'

// Import the tooltip component
import VueCustomTooltip from '@adamdehaven/vue-custom-tooltip'

export default ({
  Vue, // the version of Vue being used in the VuePress app
  options, // the options for the root Vue instance
  router, // the router instance for the app
  siteData, // site metadata
  isServer, // is this enhancement applied in server-rendering or client
}) => {
  // ...apply enhancements to the app

  // Install the plugin using ONE of the options below:
  // --------------------------------------------------

  // 1\. Install with default options
  Vue.use(VueCustomTooltip)

  // ===== OR  =====

  // 2\. Install with custom options (defaults shown)
  Vue.use(VueCustomTooltip, {
    name: 'VueCustomTooltip',
    color: '#fff',
    background: '#000',
    borderRadius: 12,
    fontWeight: 400,
  })
}

In-Component Install

Alternatively, you may install the component directly within a single file in your project; however, you will not be able to customize the Vue.use() options.

<!-- Single file component -->

<script>
  // Import the tooltip component (no options available)
  import VueCustomTooltip from '@adamdehaven/vue-custom-tooltip'

  // .vue file default export
  export default {
    // Register the component
    components: {
      VueCustomTooltip,
    },
  }
</script>

Note: Installing inside a single component (instead of globally) does not allow you to customize the Plugin Options; however, you may still utilize all props on the <VueCustomTooltip> element.

CDN

Import the tooltip component after importing Vue in your file after importing Vue. Installing via CDN does not allow for customizing Plugin Options.

Installing via the CDN requires using the kebob-case component name.

<!-- Import Vue -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- Import tooltip component -->
<script src="https://unpkg.com/@adamdehaven/vue-custom-tooltip"></script>

<!-- Then simply use the component -->
<p>This is a <vue-custom-tooltip label="Neat!" underlined>tooltip</vue-custom-tooltip>.</p>

Manual

Download dist/vue-custom-tooltip.min.js and include it in your file after importing Vue. Installing manually does not allow for customizing Plugin Options.

Installing manually requires using the kebob-case component name.

<!-- Import Vue -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- Import tooltip component -->
<script src="https://unpkg.com/@adamdehaven/vue-custom-tooltip"></script>

<!-- Then simply use the component -->
<p>This is a <vue-custom-tooltip label="Neat!" underlined>tooltip</vue-custom-tooltip>.</p>

Usage

<!-- Basic -->
What is <VueCustomTooltip label="This is a tooltip">a tooltip</VueCustomTooltip>?

<!-- With Props -->
What is
<VueCustomTooltip label="This is a tooltip" position="is-bottom" abbreviation sticky>a tooltip</VueCustomTooltip>?

<!-- With element(s) -->
<VueCustomTooltip label="View @adamdehaven on Twitter">
  <a class="button" href="https://twitter.com/adamdehaven">
    <
    <span>Twitter</span>
  </a>
</VueCustomTooltip>

Options

Pass any of the options listed below to Vue.use(VueCustomTooltip, {...}) to customize the plugin for your project (not available with in-component installation).

A note on options tied to CSS properties

The color, background, borderRadius, and fontWeight attributes listed below are set on the psuedo element using CSS Variables (Custom Properties), meaning they will fallback to their default values in unsupported browsers (e.g. Internet Explorer).

name

  • Type: String
  • Default: VueCustomTooltip

Customize the name of the component you will use in your project. Camel-case names are preferred, as this allows for camel-case or kebob-case usage within your project.

Vue.use(VueCustomTooltip, {
  name: 'SuperCoolTooltip', // camel-case preferred
})

If you registered the name using camel-case, you can reference the tooltip component via camel-case or kebob-case:

<!-- Default name (user did not pass the 'name' option) -->

<!-- camel-case -->
Nice <VueCustomTooltip label="Neat!">tooltip</VueCustomTooltip>!
<!-- kebob-case -->
Nice <vue-custom-tooltip label="Neat!">tooltip</vue-custom-tooltip>!

<!-- Custom name (allows user to rename component) -->

<!-- camel-case -->
Nice <SuperCoolTooltip label="Neat!">tooltip</SuperCoolTooltip>!
<!-- kebob-case -->
Nice <super-cool-tooltip label="Neat!">tooltip</super-cool-tooltip>!

color

  • Type: HEX Color
  • Default: #fff

Customize the color of the text displayed in the tooltip.

Vue.use(VueCustomTooltip, {
  color: '#c1403d', // 3 or 6 digit HEX color, including a leading hash (#)
})

background

  • Type: HEX Color
  • Default: #000

Customize the background color (and the underlined text color) of the tooltip.

Vue.use(VueCustomTooltip, {
  background: '#1b2735', // 3 or 6 digit HEX color, including a leading hash (#)
})

borderRadius

  • Type: Number
  • Default: 12

Customize the border-radius of the tooltip. Must be an integer.

Vue.use(VueCustomTooltip, {
  borderRadius: 4,
})

fontWeight

  • Type: Number
  • Default: 400

Customize the font-weight of the tooltip text. Must be an integer that is a multiple of 100, between 100 - 900.

Vue.use(VueCustomTooltip, {
  fontWeight: 700,
})

Props

In addition to the Plugin Options above, you may also pass props to the component itself to customize both the look and behavior of the tooltip element.

Props that accept a Boolean value may be passed simply by adding the attribute to the component tag, if a true value is desired. See the sticky example here:

<VueCustomTooltip label="Tooltip" sticky>text/element</VueCustomTooltip>

All other props may be passed as normal attributes (if the corresponding value is a String, like the label prop, shown above) or with v-bind directives, as shown here:

<VueCustomTooltip :label="element.helpText" :sticky="false">text/element</VueCustomTooltip>

All available props for the tooltip component are listed below:

label

  • Type: String
  • Default: null

The text that will display inside the tooltip. If the value for label is null, the tooltip will not be displayed.

You may not pass HTML to the label prop.

active

  • Type: Boolean
  • Default: true

Determines whether the tooltip should display when hovered, or if the sticky prop is present, if the tooltip should be visible.

position

  • Type: String
  • Value: is-top / is-bottom / is-left / is-right
  • Default: is-top

The position of the tooltip in relation to the text/element it is surrounding.

abbreviation

  • Type: Boolean
  • Default: false

Swaps out the component’s standard <span> element with a semantically-correct <abbr> element, and sets the underlined prop to true. This is useful when adding a tooltip to text within a page’s content where you want to provide additional context to a word or phrase, or provide a definition of a word or acronym.

VuePress pages are served as an <VueCustomTooltip label="Single Page Application" abbreviation>SPA</VueCustomTooltip>.

sticky

  • Type: Boolean
  • Default: false

Determines if the tooltip should always be displayed (including on component load/mounting), regardless of the element being hovered.

underlined

  • Type: Boolean
  • Default: false

Add a dotted border under the contained text (the same color as the background HEX value). This value is automatically set to true if the abbreviation prop is set to true.

multiline

  • Type: Boolean
  • Default: false

Allows the tooltip text to wrap to multiple lines as needed. Can be used in conjunction with the size prop to adjust the width of the tooltip.

size

  • Type: String
  • Value: is-small / is-medium / is-large
  • Default: is-medium

The width of the tooltip, if the multiline prop is set to true.

Adding Custom Classes & Styles

Just like any other Vue component, you can add classes or styles directly to the component tag that will be applied to the rendered <span> tag (or <abbr> tag, if abbreviation is set to true).

<!-- Tooltip component with custom classes and styles -->
<VueCustomTooltip class="your-class" :class="{ 'dynamic-class': isDynamic }" :style="{ display: 'inline' }" label="Neat"
  >text</VueCustomTooltip
>

This is extremely helpful if you want to extend functionality or tooltip styles within your project, which allows you to tweak things like the display behavior of the tooltip element.

The tooltip component is rendered as a display: inline-block element by default; however, you can override this by binding styles directly to the component, as shown above.

Download Details:

Author: adamdehaven
Source Code: https://github.com/adamdehaven/vue-custom-tooltip

#vue #javascript #web-development

What is GEEK

Buddha Community

A Reusable Tooltip Component for Vue
Luna  Mosciski

Luna Mosciski

1600583123

8 Popular Websites That Use The Vue.JS Framework

In this article, we are going to list out the most popular websites using Vue JS as their frontend framework.

Vue JS is one of those elite progressive JavaScript frameworks that has huge demand in the web development industry. Many popular websites are developed using Vue in their frontend development because of its imperative features.

This framework was created by Evan You and still it is maintained by his private team members. Vue is of course an open-source framework which is based on MVVM concept (Model-view view-Model) and used extensively in building sublime user-interfaces and also considered a prime choice for developing single-page heavy applications.

Released in February 2014, Vue JS has gained 64,828 stars on Github, making it very popular in recent times.

Evan used Angular JS on many operations while working for Google and integrated many features in Vue to cover the flaws of Angular.

“I figured, what if I could just extract the part that I really liked about Angular and build something really lightweight." - Evan You

#vuejs #vue #vue-with-laravel #vue-top-story #vue-3 #build-vue-frontend #vue-in-laravel #vue.js

Sofia Kelly

Sofia Kelly

1578061020

10 Best Vue Icon Component For Your Vue.js App

Icons are the vital element of the user interface of the product enabling successful and effective interaction with it. In this article, I will collect 10 Vue icon component to bring more interactivity, better UI design to your Vue application.

1. Animated SweetAlert Icons for Vue

A clean and simple Vue wrapper for SweetAlert’s fantastic status icons. This wrapper is intended for users who are interested in just the icons. For the standard SweetAlert modal with all of its bells and whistles, you should probably use Vue-SweetAlert 2

Animated SweetAlert Icons for Vue

Demo: https://vue-sweetalert-icons.netlify.com/

Download: https://github.com/JorgenVatle/vue-sweetalert-icons/archive/master.zip

2. vue-svg-transition

Create 2-state, SVG-powered animated icons.

vue-svg-transition

Demo: https://codesandbox.io/s/6v20q76xwr

Download: https://github.com/kai-oswald/vue-svg-transition/archive/master.zip

3. Vue-Awesome

Awesome SVG icon component for Vue.js, with built-in Font Awesome icons.

Vue-Awesome

Demo: https://justineo.github.io/vue-awesome/demo/

Download: https://github.com/Justineo/vue-awesome/archive/master.zip

4. vue-transitioning-result-icon

Transitioning Result Icon for Vue.js

A scalable result icon (SVG) that transitions the state change, that is the SVG shape change is transitioned as well as the color. Demonstration can be found here.

A transitioning (color and SVG) result icon (error or success) for Vue.

vue-transitioning-result-icon

Demo: https://transitioning-result-icon.dexmo-hq.com/

Download: https://github.com/dexmo007/vue-transitioning-result-icon/archive/master.zip

5. vue-zondicons

Easily add Zondicon icons to your vue web project.

vue-zondicons

Demo: http://www.zondicons.com/icons.html

Download: https://github.com/TerryMooreII/vue-zondicons/archive/master.zip

6. vicon

Vicon is an simple iconfont componenet for vue.

iconfont
iconfont is a Vector Icon Management & Communication Platform made by Alimama MUX.

vicon

Download: https://github.com/Lt0/vicon/archive/master.zip

7. vue-svgicon

A tool to create svg icon components. (vue 2.x)

vue-svgicon

Demo: https://mmf-fe.github.io/vue-svgicon/v3/

Download: https://github.com/MMF-FE/vue-svgicon/archive/master.zip

8. vue-material-design-icons

This library is a collection of Vue single-file components to render Material Design Icons, sourced from the MaterialDesign project. It also includes some CSS that helps make the scaling of the icons a little easier.

vue-material-design-icons

Demo: https://gitlab.com/robcresswell/vue-material-design-icons

Download: https://gitlab.com/robcresswell/vue-material-design-icons/tree/master

9. vue-ionicons

Vue Icon Set Components from Ionic Team

Design Icons, sourced from the Ionicons project.

vue-ionicons

Demo: https://mazipan.github.io/vue-ionicons/

Download: https://github.com/mazipan/vue-ionicons/archive/master.zip

10. vue-ico

Dead easy, Google Material Icons for Vue.

This package’s aim is to get icons into your Vue.js project as quick as possible, at the cost of all the bells and whistles.

vue-ico

Demo: https://material.io/resources/icons/?style=baseline

Download: https://github.com/paulcollett/vue-ico/archive/master.zip

I hope you like them!

#vue #vue-icon #icon-component #vue-js #vue-app

Henry Short

Henry Short

1578472348

7 Best Vue Highlight Component for Your Vue App

Vue highlight is often used to highlight text and syntax. Here are the 7 Vue highlight components I’ve collected.

1. vue-snippets

Vue3 Snippets, This extension adds Vue3 Code Snippets into Visual Studio Code.

vue-snippets

Download


2. vim-vue-plugin

Vim syntax and indent plugin for vue files

vim-vue-plugin

Download


3. vue-highlighter

Vue directive for highlight multiple istances of a word.

vue-highlighter

Download


4. vue-code-highlight

Beautiful code syntax highlighting as Vue.js component.

vue-code-highlight

Download


5. Vue Prism Editor

A dead simple code editor with syntax highlighting and line numbers. 7kb/gz

Features

  • Code Editing ^^
  • Syntax highlighting
  • Undo / Redo
  • Copy / Paste
  • The spaces/tabs of the previous line is preserved when a new line is added
  • Works on mobile (thanks to contenteditable)
  • Resize to parent width and height
  • Support for line numbers
  • Support for autosizing the editor
  • Autostyling the linenumbers(optional)

Vue Prism Editor

Demo

Download


6. vue-highlight-words

A simple port from react-highlight-words

Vue component to highlight words within a larger body of text.

vue-highlight-words

Demo

Download


7. vue-highlight-text

Vue component for highlight multiple istances of a word.

vue-highlight-text

Demo

Download


Thank for read!

#vue-highlight #vue #vue-highlight-component #highlight-vue

Alfie Kemp

Alfie Kemp

1578332107

Collection of 10 Vue Markdown Component for Vue.js App in 2020

Markdown is a way to style text on the web. You control the display of the document; formatting words as bold or italic, adding images, and creating lists are just a few of the things we can do with Markdown.

The 10 Vue markdown components below will give you a clear view.

1. Vue Showdown

Use showdown as a Vue component.

Vue Showdown

View Demo

Download Source

2. showdown-markdown-editor

A markdown editor using codemirror and previewer using showdown for Vue.js.

showdown-markdown-editor

View Demo

Download Source

3. markdown-it-vue

The vue lib for markdown-it.

markdown-it-vue

View Demo

Download Source

4. perfect-markdown

perfect-markdown is a markdown editor based on Vue & markdown-it. The core is inspired by the implementation of mavonEditor, so perfect-markdown has almost all of the functions of mavonEditor. What’s more, perfect-markdown also extends some features based on mavonEditor.

perfect-markdown

View Demo

Download Source

5. v-markdown-editor

Vue.js Markdown Editor component.

This is image title

View Demo

Download Source

6. markdown-to-vue-loader

Markdown to Vue component loader for Webpack.

markdown-to-vue-loader

View Demo

Download Source

7. fo-markdown-note Component for Vue.js

fo-markdown-note is a Vue.js component that provides a simple Markdown editor that can be included in your Vue.js project.

fo-markdown-note is a thin Vue.js wrapper around the SimpleMDE Markdown editor JavaScript control.

fo-markdown-note Component for Vue.js

View Demo

Download Source

8. Vue-SimpleMDE

Markdown Editor component for Vue.js. Support both vue1.0 & vue2.0

Vue-SimpleMDE

View Demo

Download Source

9. mavonEditor

A nice vue.js markdown editor. Support WYSIWYG editing mode, reading mode and so on.

mavonEditor

View Demo

Download Source

10. vue-markdown

A Powerful and Highspeed Markdown Parser for Vue.

vue-markdown

View Demo

Download Source

Thank for read!

#vue-markdown #vue-js #vue-markdown-component #vue

Andrew French

1578387349

10 Best Vue Form Component for Your Vue App

Vue Form component is a tool to help you solve the problem of allowing end-users to interact with the data and modify the data in your application.
In this article I will come up with 11 Vue form components that I find very helpful.

1. Vuetify-Form-Base

vuetify-form-base is a Vue Component and can easily integrated into any Vue Project.

The Schema-Object has the same structure as the Value-Object. Create a Schema by cloning the Value-Object and replace the Values of the Data-Object by Definitions for your your Schema. The corresponding Schema-Object defines type, layout and functional behaviour of your Form.

Features

  • Vue-Component
  • integrates UI framework Vuetify with responsive Layout and Support of Grid
  • Use a lot of Vuetify Control & Input types inclusive available API-Props
  • Get full configurable Forms based on Schema Definition
  • Edit plain or deep nested objects including Arrays, without the Need to flatten it
  • Get a Full reactive Result
  • Listen on ‘Resize’, ‘Focus’, ‘Input’, ‘Click’, ‘Swipe’ and ‘Update’ Events
  • Use Slots to pass Header and Footer into a Control. Or replace a Control by Slot
  • Configurable CSS Style

Vuetify-Form-Base

Demo

Download


2. FormVuelar

FormVuelar is a set of predefined vue form components which are designed to automatically display errors coming back from your backend. It works out of the box with the error message bag that is returned by Laravel when submitting an ajax form.

FormVuelar

Demo

Download


3. vue-form-components

Clean & minimal vue form elements with validation.

vue-form-components

Demo

Download


4. example-list-form

Form Dinamis dengan menggunakan Vue.js.

example-list-form

Download


5. vue-genesis-forms

Easy create forms in Vue.js

vue-genesis-forms

Demo

Download


6. FormBuilder

Laravel Enso Form Builder is a customizable, template based form creator, so you can quickly create forms with the minimum amount of effort

FormBuilder

Demo

Download


7. vfg-field-array

A vue-form-generator field to handle arrays.

vfg-field-array

Download


8. vue-formbuilder2.0

ElementUI Form Builder.

Basic code was clone from https://github.com/jmeei/vue-formbuilder, and did some improve.

vue-formbuilder2.0

Demo

Download


9. vue-interactive-paycard

A fantastic credit card form with smooth and sweet micro-interactions. Includes number formatting, validation and automatic card type detection. Built with vuejs and also fully responsive.

vue-interactive-paycard

Demo

Download


10. vue-dynamic-form-component

vue-dynamic-form-component is a dynamic form component base on element-ui and async-validator. You just need to write descriptors(reference to async-validator) of the data you want, vue-dynamic-form-component will generate the form automatically.

vue-dynamic-form-component

Demo

Download


Thank for read!

#vue-js #vue-form #vue-form-component #form-component