Search results

Integrate avatar into Badge in JavaScript Avatar control

The badge is dependent and supportive component, and it can be used with avatar to create a notification avatar. The default avatar (.e-avatar) and circle avatar (.e-avatar-circle) have been used with notification badges (.e-badge-notification) in the following sample.

Source
Preview
index.html
<!DOCTYPE html>
<html lang="en">

<head>
    <title>Essential JS 2 for Avatar </title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Essential JS 2 for Avatar UI Control" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/ej2-base/styles/material.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/ej2-layouts/styles/material.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/ej2-notifications/styles/material.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'>
            <div class="sample_container avatar-badge">
                <div class="avatar-block">
                    <!-- Card Component -->
                    <div class="e-card e-avatar-showcase">
                        <div class="e-card-content">
                            <div class="avatar-sub-block">
                                <!-- xSmall Avatar-->
                                <div class="e-avatar e-avatar-xsmall">
                                    <img src="./pic01.png" alt="profile_pic">
                                </div>
                                <!-- Notification Badge -->
                                <span class="e-badge e-badge-primary e-badge-overlap e-badge-notification e-badge-circle">6</span>
                            </div>
                            <div class="avatar-sub-block">
                                <!-- Small Avatar-->
                                <div class="e-avatar e-avatar-small">
                                    <img src="./pic01.png" alt="profile_pic">
                                </div>
                                <!-- Notification Badge -->
                                <span class="e-badge e-badge-primary e-badge-overlap e-badge-notification e-badge-circle">12</span>
                            </div>
                            <div class="avatar-sub-block">
                                <!-- Avatar-->
                                <div class="e-avatar">
                                    <img src="./pic01.png" alt="profile_pic">
                                </div>
                                <!-- Notification Badge -->
                                <span class="e-badge e-badge-primary e-badge-overlap e-badge-notification">46</span>
                            </div>
                            <div class="avatar-sub-block">
                                <!-- Large Avatar-->
                                <div class="e-avatar e-avatar-large">
                                    <img src="./pic01.png" alt="profile_pic">
                                </div>
                                <!-- Notification Badge -->
                                <span class="e-badge e-badge-primary e-badge-overlap e-badge-notification">82</span>
                            </div>
                            <div class="avatar-sub-block">
                                <!-- xLarge Avatar-->
                                <div class="e-avatar e-avatar-xlarge">
                                    <img src="./pic01.png" alt="profile_pic">
                                </div>
                                <!-- Notification Badge -->
                                <span class="e-badge e-badge-primary e-badge-overlap e-badge-notification">99+</span>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="circleAvatar avatar-block">
                    <!-- Card Component -->
                    <div class="e-card e-avatar-showcase">
                        <div class="e-card-content">
                            <div class="avatar-sub-block">
                                <!-- xSmall Circle Avatar-->
                                <div class="e-avatar e-avatar-circle e-avatar-xsmall">
                                    <img src="./pic01.png" alt="profile_pic">
                                </div>
                                <!-- Notification Badge -->
                                <span class="e-badge e-badge-primary e-badge-overlap e-badge-notification e-badge-circle">6</span>
                            </div>
                            <div class="avatar-sub-block">
                                <!-- Small Circle Avatar-->
                                <div class="e-avatar e-avatar-circle e-avatar-small">
                                    <img src="./pic01.png" alt="profile_pic">
                                </div>
                                <!-- Notification Badge -->
                                <span class="e-badge e-badge-primary e-badge-overlap e-badge-notification e-badge-circle">12</span>
                            </div>
                            <div class="avatar-sub-block">
                                <!-- Circle Avatar-->
                                <div class="e-avatar e-avatar-circle">
                                    <img src="./pic01.png" alt="profile_pic">
                                </div>
                                <!-- Notification Badge -->
                                <span class="e-badge e-badge-primary e-badge-overlap e-badge-notification">46</span>
                            </div>
                            <div class="avatar-sub-block">
                                <!-- Large Circle Avatar-->
                                <div class="e-avatar e-avatar-circle e-avatar-large">
                                    <img src="./pic01.png" alt="profile_pic">
                                </div>
                                <!-- Notification Badge -->
                                <span class="e-badge e-badge-primary e-badge-overlap e-badge-notification">82</span>
                            </div>
                            <div class="avatar-sub-block">
                                <!-- xLarge Circle Avatar-->
                                <div class="e-avatar e-avatar-circle e-avatar-xlarge">
                                    <img src="./pic01.png" alt="profile_pic">
                                </div>
                                <!-- Notification Badge -->
                                <span class="e-badge e-badge-primary e-badge-overlap e-badge-notification">99+</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>

</html>