Coder Social home page Coder Social logo

vaadin-component-factory / vcf-avatar-group Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 46 KB

Vaadin Component Factory Avatar Group

Home Page: https://vcf-avatar-group.netlify.com/

License: Other

HTML 17.71% JavaScript 82.29%
vaadin polymer3 webcomponent avatar-group

vcf-avatar-group's Introduction

<vcf-avatar-group>

Demo

https://vcf-avatar-group.netlify.com/

Installation

Install vcf-avatar-group:

npm i @vaadin-component-factory/vcf-avatar-group --save

Usage

Once installed, import it in your application:

import '@vaadin-component-factory/vcf-avatar-group';

And use it:

<vcf-avatar-group></vcf-avatar-group>
const people = [
  { name: 'Dave' },
  { abbr: 'JD' },
  { name: 'Hannah' },
  { image: 'https://randomuser.me/api/portraits/women/5.jpg', name: 'Jane' }
];
const avatarGroup = document.querySelector('vcf-avatar-group');
avatarGroup.items = people;

For each item, you can provide a name, abbr, or image. Please refer to vcf-avatar-item for more info.

You can set a max attribute to limit how many avatar items are shown. By default, the limit is 4.

Running demo

  1. Fork the vcf-avatar-group repository and clone it locally.

  2. Make sure you have npm installed.

  3. When in the vcf-avatar-group directory, run npm install to install dependencies.

  4. Run npm start to open the demo.

Contributing

To contribute to the component, please read the guideline first.

License

Commercial Vaadin Add-on License version 3 (CVALv3). For license terms, see LICENSE.

Vaadin collects development time usage statistics to improve this product. For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.

vcf-avatar-group's People

Contributors

sohrabtaee avatar

Stargazers

 avatar  avatar

Watchers

 avatar

vcf-avatar-group's Issues

Depending on this breaks the app

This component depends on a pre-release of vcf-avatar-item and if used with the latest 1.0.4 it breaks the loading of the app with this client error:

Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "vcf-avatar-item" has already been used with this registry

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.