Avatar classes to extend Bootstrap 5.

Overview

GitHub

Bootstrap Avatar

A collection of fixed and responsive CSS for styling avatars.

Demo

https://ghoststead.github.io/bootstrap-avatar

Installation

jsDelivr CDN

<link href="https://cdn.jsdelivr.net/npm/bootstrap-avatar@latest/dist/avatar.min.css" rel="stylesheet">

The CDN version can be used without Bootstrap if desired.

Bootstrap build

The package contains a file named _avatar.scss which may be incorporated into the standard Bootstrap build tools.

Install via npm:

npm install bootstrap-avatar

Add the following line (or similar) to your top-level scss file:

@import "node_modules/bootstrap-avatar/scss/avatar";

Examples

Avatar with Bootstrap icons

Avatar circle icon

<img class="avatar avatar-16 bg-light rounded-circle text-white p-1"
     src="https://raw.githubusercontent.com/twbs/icons/main/icons/person.svg">
<img class="avatar avatar-24 bg-light rounded-circle text-white p-1"
     src="https://raw.githubusercontent.com/twbs/icons/main/icons/person-fill.svg">
<img class="avatar avatar-32 bg-light rounded-circle text-white p-2"
     src="https://raw.githubusercontent.com/twbs/icons/main/icons/person-fill.svg">
<img class="avatar avatar-48 bg-light rounded-circle text-white p-2"
     src="https://raw.githubusercontent.com/twbs/icons/main/icons/person-fill.svg">
<img class="avatar avatar-64 bg-light rounded-circle text-white p-2"
     src="https://raw.githubusercontent.com/twbs/icons/main/icons/person-fill.svg">
<img class="avatar avatar-96 bg-light rounded-circle text-white p-2"
     src="https://raw.githubusercontent.com/twbs/icons/main/icons/person-fill.svg">
<img class="avatar avatar-128 bg-light rounded-circle text-white p-2"
     src="https://raw.githubusercontent.com/twbs/icons/main/icons/person-fill.svg">

Avatar with rounded text

Avatar with Bootstrap icons

Avatar circle icon

<span class="avatar avatar-16 bg-secondary text-white rounded-2">b</span>
<span class="avatar avatar-24 bg-secondary text-white rounded-2">b</span>
<span class="avatar avatar-32 bg-secondary text-white rounded-2">b</span>
<span class="avatar avatar-48 bg-secondary text-white rounded-2">b</span>
<span class="avatar avatar-64 bg-secondary text-white rounded-2">b</span>
<span class="avatar avatar-96 bg-secondary text-white rounded-2">b</span>
<span class="avatar avatar-128 bg-secondary text-white rounded-2">b</span>

Responsive avatars

You can create avatars that resize basic on the viewport width:

<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="avatar avatar-16 avatar-md-24 avatar-lg-32 avatar-xl-64 avatar-xxl-128 text-primary" viewBox="0 0 16 16">
    <path d="M13.468 12.37C12.758 11.226 11.195 10 8 10s-4.757 1.225-5.468 2.37A6.987 6.987 0 0 0 8 15a6.987 6.987 0 0 0 5.468-2.63z"></path>
    <path fill-rule="evenodd" d="M8 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"></path>
    <path fill-rule="evenodd" d="M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zM0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8z"></path>
</svg>

This example uses the Bootstrap person-circle icon as an inline SVG then adds the responsive classes -md-24, -lg-32 etc so that the image grows with screen size.

These examples and others can be found on the demo page.

Development

Setup

  • Clone the repo
  • Run npm i

Build

The CSS files are generated from style.css via:

npm run build

Serve

npm run serve

The above commands serves a local version of the demo page.


This repository is maintained by Ghoststead.

You might also like...

Dm-utils - Utility classes for ioBroker adapters to support ioBroker.dm

dm-utils Utility classes for ioBroker adapters to support ioBroker.dm. How to use In your ioBroker adapter, add a subclass of DeviceManagement and ove

Jan 2, 2022

A concise collection of classes for PHP, Python, JavaScript and Ruby to calculate great circle distance, bearing, and destination from geographic coordinates

GreatCircle A set of three functions, useful in geographical calculations of different sorts. Available for PHP, Python, Javascript and Ruby. Live dem

Sep 30, 2022

Qwerty is the first social website focused on connecting students with similar classes and gender identities

Qwerty is the first social website focused on connecting students with similar classes and gender identities

🌈 Qwerty 🌈 Qwerty is the first social website focused on connecting students with similar classes and gender identities. To get started simply input

Oct 21, 2022

This plugin add a new utilities classes so you can use from 0% to 100%!

This plugin add new utilities classes so you can use from 0% to 100%!

Apr 3, 2022

linuxbu - a chrome extension that helps you to enter SBU classes via html-view in linux

linuxbu is a chrome extension that helps you to enter SBU classes via html-view in linux

Dec 19, 2022

Personal project to a student schedule classes according his course level. Using GraphQL, Clean Code e Clean Architecture.

Personal project to a student schedule classes according his course level. Using GraphQL, Clean Code e Clean Architecture.

classes-scheduler-graphql This is a personal project for student scheduling, with classes according his course level. I intend to make just the backen

Jul 9, 2022

A new project from Edgemony classes

A new project from Edgemony classes

TRICILY A new project from Edgemony classes Technologies used HTML5 CSS3 SASS Javascript React.js Next.js Musement API Made with ❤️ Features Designed

Jun 11, 2022

An npm package with Tailwind CSS utility classes for creating responsive grid columns without media queries using auto fit.

Grid Auto Fit for Tailwind CSS A plugin that helps you create a responsive grid layout in Tailwind CSS without using media queries. It uses the auto-f

Dec 28, 2022

Refractor to use JavaScript classes and functionalities to build a booklist web application.

BOOKLIST-APP This is a personal project that aims at using JavaScript classes to build a medium-fidelity wireframe such that a user can add or remove

Aug 18, 2022
Owner
null
Extends Bootstrap Tooltips and Popovers by adding custom classes. Available for Bootstrap 3 and Bootstrap 4.

Bootstrap Tooltip Custom Class Extends Bootstrap Tooltips and Popovers by adding custom classes. Available for Bootstrap 3 and Bootstrap 4. Define you

Andrei Victor Bulearca 14 Feb 10, 2022
🤖 Tailwind CSS assistant helps you to edit classes (includes JIT & ignores purge), toggle breakpoint classes on an element and view current breakpoint

Tailwind CSS Assistant See it in action on this example website ?? ✅ Small JavaScript package that helps you work with Tailwind CSS by... Showing you

Mark Mead 30 Dec 28, 2022
A simple Form Validation Utility for Bootstrap 3, Bootstrap 4, and Bootstrap 5 for Humans.

bootstrap-validate A simple Form Validation Utility for Bootstrap 3, Bootstrap 4, and Bootstrap 5 for Humans. ?? Support us with Developer Merchandise

null 138 Jan 2, 2023
基于React开发的新一代web调试工具,支持React组件调试,类似于Chrome Devtools。A Lightweight, Easy To Extend Web Debugging Tool Build With React

English | 简体中文 基于React开发的移动web调试工具 更新日志 简单易用 功能全面 易扩展 高性能 使用cdn方式,一键接入 类Chrome devtools, 内嵌React开发者工具,支持日志,网络,元素,代理,存储,性能等, 具有更好的网络捕获能力和丰富的日志展现形式 暴露内部

腾讯TNTWeb前端团队 236 Dec 25, 2022
Lip-sync VRM avatar client for zero-webcam mic-based vtubing

VU-VRM A lip-sync VRM avatar client for zero-webcam mic-based vtubing: automattic.github.io/VU-VRM/ Why? Because multitasking. Because sometimes you n

Automattic 10 Oct 19, 2022
📦 Alpine JS plugin to extend the functionality of the official $persist plugin

Alpine JS Persist Extended Alpine JS magic method $storage extends the official $persist plugin to help you work with local storage ?? Example ?? <div

Mark Mead 11 Dec 28, 2022
Minimalistic configuration for TS to only extend JS with types. No TS features, no bundling. Readable maintainable code after compilation.

ts-guideline Minimalistic configuration for TS to only extend JS with types. No TS-scpecific features, no bundling. Readable maintainable code after c

Georg Oldenburger 41 Dec 22, 2022
Forked from hayes0724/shopify-packer Modern development tool for Shopify using Webpack 5. Easy to extend and customize, zero build config, compatible with Slate and existing websites.

Shopify Packer Modern development tool for Shopify using Webpack 5. Easy to extend and customize, zero build config, comes with starter themes and com

Web & Mobile | eCommerce | Full-Stack Developer 4 Nov 24, 2022
Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.

Bootstrap Colorpicker Bootstrap Colorpicker is a modular color picker plugin for Bootstrap 4. THIS PROJECT IS NOT MAINTAINED ANYMORE. After almost 10

Javi Aguilar 1.4k Dec 22, 2022
Small library to create classes without using class syntax.

Clazz.js Small library to create classes without using class syntax. Compatibility For internet explorer 11 or higher. Example <script src="Clazz.js">

Emanuel R. Vásquez 1 Dec 25, 2021