Socket
Socket
Sign inDemoInstall

@contentful/f36-avatar

Package Overview
Dependencies
Maintainers
168
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/f36-avatar

Forma 36: Avatar component


Version published
Weekly downloads
7K
decreased by-40.97%
Maintainers
168
Weekly downloads
 
Created
Source

title: 'Avatar' type: 'component' status: 'alpha' slug: /components/avatar/ github: 'https://github.com/contentful/forma-36/tree/main/packages/components/avatar' storybook: 'https://f36-storybook.contentful.com/?path=/story/components-avatar--overview' typescript: ./src/Avatar.tsx

Avatar can be used to visually represent users and apps.

Import

import { Avatar, Size, Variant } from '@contentful/f36-avatar';

Examples

Variants

The Avatar can be rendered in different variants:

  • User - default variant
  • App - default variant

Sizes

The Avatar can be rendered in different sizes:

  • Tiny - 20px
  • Small - 24px
  • Medium - 32px, default size
  • Large - 48px

Show Color Border

The Avatar can be rendered with outline colors, the color is determined by the position of the Avatar. There are 6 different colors: green, red, yellow, orange, purple and gray

IsPrimary

The Avatar can be rendered with a special color border reserved for the current user

IsActive

This property modifies the opacity of the Avatar component when it is not active

Icons

An Avatar can display an icon on top of the image

Fallback

In some cases a user or an app will have no avatar to display. Instead, a fallback can be rendered when the src property is undefined (or an empty string "") and the loading state is not true.

Loading skeleton

When the avatar image is loading, a loading skeleton will be shown automatically. You can also force the loading state with the isLoading prop.

Props (API reference)

Accessibility

Make sure to pass a fitting alt property, especially if the avatar is used by itself without the user's name next to it.

FAQs

Package last updated on 05 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc