Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@workday/canvas-kit-react-avatar
Advanced tools
Readme
A component showing a user's photo with a circular crop.
yarn add @workday/canvas-kit-react
or
yarn add @workday/canvas-kit-react-avatar
import * as React from 'react';
import {Avatar, AvatarVariant} from '@workday/canvas-kit-react-avatar';
// Basic button with click handler
<Avatar onClick={someFunction} />
// Rendering as a div instead of a button
<Avatar as="div" />
// Using static properties on Avatar
<Avatar
size={Avatar.Size.xs}
variant={Avatar.Variant.Dark}
/>
// Using AvatarVariant import directly
<Avatar size={Avatar.Size.xs} variant={AvatarVariant.Dark} />
variant: AvatarVariant
<Avatar variant={Avatar.Variant.Dark} />
Size: SystemIconCircleSize | number
<Avatar size={Avatar.Size.xs} />
// Custom Size.
// Note: Please use the predefined sizes as it works nicely with the Canvas Design System
<Avatar size={48} />
None
variant: AvatarVariant
The variant of the avatar if using a default image.
Default: AvatarVariant.Light
Variant | Description |
---|---|
Light | Light grey background, dark icon |
Dark | Dark blue background, white icon |
size: SystemIconCircleSize | number
The diameter of the avatar in pixels
Default: Avatar.Size.m
Name | Size (px) |
---|---|
xs | 16 |
s | 24 |
m | 32 |
l | 40 |
xl | 64 |
xxl | 120 |
altText: string
Text describing what the avatar is showing.
url: string
The URL of the user's photo. Expects a square (1:1) photo.
ref: React.Ref<HTMLButtonElement>
A ref to the underlying
<button>
or<div>
element.
as: 'div'
Option to display the avatar as a div instead of a button.
FAQs
A circular user photo (or a default)
The npm package @workday/canvas-kit-react-avatar receives a total of 2,594 weekly downloads. As such, @workday/canvas-kit-react-avatar popularity was classified as popular.
We found that @workday/canvas-kit-react-avatar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.