vue-emoticon-picker

Simple Vue 3 emoji picker with unicode characters
13,841
Install
npm install vue-emoticon-picker
Latest Version:1.0.0
License:MIT
Last Updated:Jan 18, 2024
Links: GitHub  ·  npm
Maintainer: formdev

Emoji picker for Vue 3

Downloads Version License

Table of contents

Demo

The live demos are available here:

Installation

With npm

npm i vue-emoticon-picker --save

Import

With an ES6 bundler (via npm)

Use per component
import Emoticon from 'vue-emoticon-picker'

export default {
  // ..
  emits: ['clickEmoticon'],
  components: {
    Emoticon,
  },
  // ...
}
Use via <script setup>
import { ref, defineEmits } from 'vue'
const emit = defineEmits(['clickEmoticon'])

// ...
const input = ref('')
const emoticonRef = ref(null);

const handleClickEmoji = (emoji) => {
  input.value += emoji;
}

Very simple usage, without any CSS defined

You will need two things. A textarea (or an input), where emojis will be injected, and a component declaration. A simple example is provided below.

<template>
  <textarea v-model="input"></textarea>
  <button type="button" @click="emoticonRef.toggleShow()">:)</button>
  <!-- // .... // -->
  <Emoticon ref="emoticonRef" @click-emoticon="handleClickEmoji" />

  <!-- // .... // -->
</template>
{
  setup() {
    const emoticonRef = ref(null)

    return {
      emoticonRef
    }
  },
  data() {
    return {
      input: '',
    }
  },
  methods: {
    handleClickEmoji(emoji) {
      this.input += emoji
    },
  },
}

License

This work is an open-sourced software licensed under the MIT license.

Related Packages

nuxt-define

One utility function for module authors to define compiler constants for all bui...

13,412,511
nuxt-emoji

An Emoji component for your Nuxt 3 project.

7,980 33
@lg2/nuxt3-module-create-dato-map

nuxt3-module-create-dato-map

2,869 0
vue-embed

Embed component is based on embed.js for Vue 2.x.

2,042 57
nuxt-csurf

Nuxt Cross-Site Request Forgery (CSRF) Prevention

6,263,746 91

Version History

Version Released License
1.0.0 MIT