• This repository has been archived on 05/Jun/2020
  • Stars
    star
    560
  • Rank 79,541 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Font Awesome Icon Picker component for Bootstrap.

fontawesome-iconpicker

npm

Font Awesome Icon Picker is a fully customizable plugin for Twitter Bootstrap, with a powerful base API, based on bootstrap-popover-picker

You can use Font Awesome 5 or another font icon set of your choice (icon list is totally customizable).

View demos

Instantiation

You can call the plugin in several ways:

// Create instance if not exists (returns a jQuery object)
$('.my').iconpicker();
$('.my').iconpicker({ /*options*/ }); // you can also specify options via data-* attributes

// For the first matched element, access to a plugin property value
$('.my').data('iconpicker').iconpickerProperty;

// For the first matched element, call a plugin instance method with the given args
$('.my').data('iconpicker').iconpickerMethod('methodArg1', 'methodArg2' /* , other args */);

// Call and apply a plugin method to EACH matched element.
$.iconpicker.batch('.my', 'iconpickerMethod', 'methodArg1', 'methodArg2' /* , other args */); ->

Triggered Events

All of them exposes the plugin instance through event.iconpickerInstance

In order of call:

  • iconpickerCreate
  • iconpickerCreated
  • iconpickerShow
  • iconpickerShown
  • iconpickerSelect (also exposes event.iconpickerItem and event.iconpickerValue)
  • iconpickerUpdate
  • iconpickerInvalid (also exposes event.iconpickerValue)
  • iconpickerSetValue (also exposes event.iconpickerValue)
  • iconpickerSetSourceValue (also exposes event.iconpickerValue)
  • iconpickerUpdated
  • iconpickerSelected (also exposes event.iconpickerItem and event.iconpickerValue)
  • iconpickerHide
  • iconpickerHidden
  • iconpickerDestroy
  • iconpickerDestroyed
// Bind iconpicker events to the element
$('.my').on('iconpickerSelected', function(event){
  /* event.iconpickerValue */
});

Popover placement extensions

This plugin comes with more placement options than the original Bootstrap Popover. Here are all the possibilities in detail:

        1 2 3 4 5
        G       6
        F       7
        E       8
        D C B A 9

0.      inline (no placement, display as inline-block)
1.      topLeftCorner
2.      topLeft
3.      top (center)
4.      topRight
5.      topRightCorner
6.      rightTop
7.      right (center)
8.      rightBottom
9.      bottomRightCorner
A.      bottomRight
B.      bottom (center)
C.      bottomLeft
D.      bottomLeftCorner
E.      leftBottom
F.      left (center)
G.      leftTop

Available options

var options = {
    title: false, // Popover title (optional) only if specified in the template
    selected: false, // use this value as the current item and ignore the original
    defaultValue: false, // use this value as the current item if input or element value is empty
    placement: 'bottom', // (has some issues with auto and CSS). auto, top, bottom, left, right
    collision: 'none', // If true, the popover will be repositioned to another position when collapses with the window borders
    animation: true, // fade in/out on show/hide ?
    //hide iconpicker automatically when a value is picked. it is ignored if mustAccept is not false and the accept button is visible
    hideOnSelect: false,
    showFooter: false,
    searchInFooter: false, // If true, the search will be added to the footer instead of the title
    mustAccept: false, // only applicable when there's an iconpicker-btn-accept button in the popover footer
    selectedCustomClass: 'bg-primary', // Appends this class when to the selected item
    icons: [], // list of icon objects [{title:String, searchTerms:String}]. By default, all Font Awesome icons are included.
    fullClassFormatter: function(val) {
        return 'fa ' + val;
    },
    input: 'input,.iconpicker-input', // children input selector
    inputSearch: false, // use the input as a search box too?
    container: false, //  Appends the popover to a specific element. If not set, the selected element or element parent is used
    component: '.input-group-addon,.iconpicker-component', // children component jQuery selector or object, relative to the container element
    // Plugin templates:
    templates: {
        popover: '<div class="iconpicker-popover popover"><div class="arrow"></div>' +
            '<div class="popover-title"></div><div class="popover-content"></div></div>',
        footer: '<div class="popover-footer"></div>',
        buttons: '<button class="iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm">Cancel</button>' +
            ' <button class="iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm">Accept</button>',
        search: '<input type="search" class="form-control iconpicker-search" placeholder="Type to filter" />',
        iconpicker: '<div class="iconpicker"><div class="iconpicker-items"></div></div>',
        iconpickerItem: '<a role="button" href="#" class="iconpicker-item"><i></i></a>',
    }
};

More Repositories

1

bootstrap-colorpicker

Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.
JavaScript
1,381
star
2

newbark-unity

🌳 A proof-of-concept Pokémon-style Retro RPG game framework created with Unity 🔥🌿💧⚡️
C#
155
star
3

pokemon-assets

The ultimate compilation of Pokémon data and assets: menu sprites, glyphs and icons, CSS spritesheets, all data in JSON format, fonts, sounds, etc.
CSS
58
star
4

autotiler

Autotile 47-tile blob tileset generator application with Godot export support. Based on Electron JS.
JavaScript
39
star
5

jsx-runtime

Extremely lightweight JSX runtime (<3KB) to write JSX without React in TypeScript or JavaScript.
TypeScript
33
star
6

livingdex

Living Dex is a Pokédex and a visual guide that helps you organizing all storable Pokémon forms and variants in Pokémon HOME boxes.
JavaScript
23
star
7

supereffective-assets

Pokémon data and assets used in SuperEffective.gg
TypeScript
19
star
8

mediatidy

🗂 Command-line tool to organize large directories of media files recursively by date, detecting duplicates.
Go
19
star
9

turborepo-react-next

Starter template monorepo with TS, ReactJS, NextJS, Prisma, TailwindCSS, NextAuth and Vitest
TypeScript
15
star
10

koffing

Online Pokémon Showdown Team parser that converts your competitive strategies to machine-readable JSON code.
TypeScript
13
star
11

supereffective

The most complete Pokémon tracker
TypeScript
8
star
12

supereffective-issues

Issue Tracker and Task Board for supereffective.gg
5
star
13

turborepo-solid-astro

Starter template repo with Turborepo + SolidJS + Astro + MDX + TypeScript support.
Astro
5
star
14

spritesheet-generator

Generates CSS, SCSS and a sprite sheet image from a directory of PNGs, using the power of Bash and ImageMagick
Shell
4
star
15

livingdex-data

Pokémon data normalisation tool, with periodically updated data from: Showdown, Veekun DB & POGOProtos.
PHP
3
star
16

ra-admin-guesser-treeql

🪄 React Admin data provider and UI scaffolder for TreeQL-powered REST APIs like PHP-CRUD-API. An automatic admin UI for your SQL databases.
TypeScript
3
star
17

newbark-gamemaker

🌳 A proof-of-concept Pokémon-style Retro RPG engine created with GameMaker 🔥🌿💧⚡️
Yacc
2
star
18

SymfonyDoctrineAppTemplate

Dockerized development environment for new Symfony (LTS) apps that use Doctrine.
PHP
1
star
19

node-gh-pages-deploy

Node script for publishing a directory into the project's gh-pages branch.
JavaScript
1
star
20

next-mdx-frontmatter

Custom @next/mdx with FrontMatter and page layouts support. Next.js + MDX + FrontMatter.
JavaScript
1
star
21

storylite

A lightweight alternative to StoryBook, built on top of Vite⚡️
TypeScript
1
star
22

movies-recommender

Simple Movie Recommender system in Python using Pandas, Sklearn and Streamlit
Jupyter Notebook
1
star
23

tidymypics

Image Classifier and Photo Library Organizer using Python and Tensorflow
Python
1
star
24

devv

📦 Containerize your local development environment without writing a line of Docker configuration. PHP, Node, Go & more
Dockerfile
1
star