Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
@patternfly/pfe-avatar
Advanced tools
pfe-avatar
is an element for displaying a user's avatar image. If the user in question has provided a custom avatar, provide it and it will be displayed. If they don't, a nice colored pattern will be generated based on their name. A specific name will always generate the same pattern, so users' avatars will stay static without the need for storing their generated image.
<pfe-avatar pfe-name="Eleanore Stillwagon"></pfe-avatar>
<pfe-avatar pfe-name="Libbie Koscinski" pfe-shape="rounded" pfe-pattern="squares"></pfe-avatar>
<pfe-avatar pfe-name="Blanca Rohloff" pfe-pattern="triangles"></pfe-avatar>
<pfe-avatar pfe-name="Edwardo Lindsey" pfe-src="https://clayto.com/2014/03/rgb-webgl-color-cube/colorcube.jpg"></pfe-avatar>
The user's name, either given name and family name, or username. When displaying a pattern, the name will be used to seed the pattern generator.
The URL to the user's custom avatar image. It will be displayed instead of a random pattern.
The type of pattern to display. Currently supported values are "squares"
and "triangles"
.
squares | triangles |
---|---|
The shape of the avatar itself. Supported values are "square"
(default), "rounded"
, and "circle"
.
Theme Var Hook | Description | Default |
---|---|---|
--pfe-avatar--colors | A space-delimited list of colors to use for generated patterns. Only hex values are supported, ex: #fc0 or #0fcb41 . Any number of colors may be provided. | #3B0083 #f0ab00 #007a87 #00b9e4 #92d400 |
npm run test
npm run build
From the PFElements root directory, run:
npm start
Avatar (and all PFElements) use Prettier to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can integrate your editor with Prettier to have the style rules applied on every save.
FAQs
Avatar for PatternFly Elements
The npm package @patternfly/pfe-avatar receives a total of 371 weekly downloads. As such, @patternfly/pfe-avatar popularity was classified as not popular.
We found that @patternfly/pfe-avatar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 16 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
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.