Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rfoel/ionic-emoji-picker

Emoji picker for Ionic 3
https://github.com/rfoel/ionic-emoji-picker

emoji emoji-picker ionic

Last synced: about 2 months ago
JSON representation

Emoji picker for Ionic 3

Awesome Lists containing this project

README

        

[![npm version](https://badge.fury.io/js/ionic-emoji-picker.svg)](https://badge.fury.io/js/ionic-emoji-picker)

# Emoji picker for Ionic 3

This project was forked from the [ionic3-emoji-picker](https://github.com/danielehrhardt/ionic3-emoji-picker) project created by [danielehrhardt](https://github.com/danielehrhardt)

# Installation

## Install the module via NPM

```shell
npm i ionic-emoji-picker --save
```

## Import it in your app's module(s)

Import `EmojiPickerModule.forRoot()` in your app's main module

app.module.ts

```ts
import { EmojiPickerModule } from 'ionic-emoji-picker';

@NgModule({
...
imports: [
...
EmojiPickerModule.forRoot()
],
...
})
export class AppModule {}
```

If your app uses lazy loading, you need to import `EmojiPickerModule` in your shared module or child modules:

```ts
import { EmojiPickerModule } from 'ionic-emoji-picker';

@NgModule({
...
imports: [
...
EmojiPickerModule
],
...
})
export class SharedModule {}
```

### Sample

```html

```

```ts
toggled: boolean = false;
message: string;

handleSelection(event) {
this.message += event.char;
}
```

### Directive API:

```html



```

### Emitter `(emojiPickerSelect)="handleSelection($event)"`

```
$event = EmojiEvent{ char : "😌", label : "relieved" }
```

## EmojiPickerCaretEmitter

added for your convenience, emits information regarding a contenteditable enabled element

### Emitter `(emojiPickerCaretEmitter)="handleCaretChange($event)"`

```
$event = CaretEvent{ caretOffset: 13, caretRange: Range{...}, textContent: 'content of div or input' }
```

Emoji Picker will get placed relative the element chosen via the directive api, centered and within window borders