forcedotcom/sf-skills / skills/design-systems-slds-apply
design-systems-slds-apply
UnverifiedApply SLDS-compliant UI using the correct blueprints, styling hooks, utility classes, and icons. Use when building any UI that needs SLDS, choosing between Lightning Base Components and SLDS Blueprints, applying styling hooks for theming, using utility classes for layout and spacing, or selecting icons. Triggers include "build a modal", "create a form", "data table", "SLDS styling", "style with hooks", "add an icon".
assets/blueprints/components/avatar.yaml
View on GitHubname: Avatar
description: A visual representation of an object, typically used to represent a user, account, or entity with customizable
sizing, shape, and fallback options.
category: Display
slds_classes:
root: slds-avatar
elements:
- class: slds-avatar__initials
description: Text initials when no image is available
purpose: Displays initials as fallback when image is not available
modifiers:
- class: slds-avatar_circle
description: Circular avatar shape
usage: Default circular appearance for avatars
- class: slds-avatar_x-small
description: Extra small avatar size
usage: Use in constrained spaces like dense lists
- class: slds-avatar_small
description: Small avatar size
usage: Use in compact layouts
- class: slds-avatar_medium
description: Medium avatar size (default)
usage: Default size for most use cases
- class: slds-avatar_large
description: Large avatar size
usage: Use for profile pages or prominent display
states: []
variants:
- name: Base
description: Avatar with image
classes:
- slds-avatar
usage_context: Default avatar with user or entity image
differences: Shows actual image of the person or entity
- name: Initials
description: Avatar with initials fallback
classes:
- slds-avatar
usage_context: When no image is available, shows initials
differences: Displays text initials instead of image
lightning_component:
name: lightning-avatar
url: https://developer.salesforce.com/docs/component-library/bundle/lightning-avatar
mapping_notes: Direct mapping - Lightning component implements SLDS avatar blueprint
accessibility:
keyboard_support:
- No specific keyboard interactions (display-only component)
screen_reader:
- Alt text announced for images
- Initials announced when used as fallback
aria_attributes:
- alt attribute for image avatars
- aria-label for initials avatars
usage_guidelines:
when_to_use:
- To represent users, accounts, or entities visually
- In lists, cards, or headers where identification is needed
- When you need consistent visual representation
when_not_to_use:
- For decorative images
- When the representation doesn't relate to a person or entity
- For actionable content
best_practices:
- Use appropriate size for the context
- Provide meaningful alt text for images
- Use initials as fallback when images aren't available
common_mistakes:
- Using avatars for non-person/entity content
- Not providing fallback options
- Inconsistent sizing within the same interface
code_examples:
- title: Basic Avatar
code: "<span class=\"slds-avatar slds-avatar_medium\">\n <img alt=\"Person name\" src=\"/assets/images/avatar1.jpg\"\
\ class=\"\" />\n </span>\n"
- title: Initials Avatar
code: "<span class=\"slds-avatar slds-avatar_medium\">\n <abbr class=\"slds-avatar__initials\" title=\"John Doe\">JD</abbr>\n\
\ </span>\n"
dependencies:
css_files:
- avatar.css
javascript: []
icons: []
other_components: []
related_components:
- name: Avatar Group
relationship: container
description: Groups multiple avatars together
- name: Media Objects
relationship: depends-on
description: Often used within media object patterns
references:
official_docs: https://v1.lightningdesignsystem.com/components/avatar/
metadata:
version: 1.0.0
last_updated: '2025-11-12'
review_status: complete
notes: ' Cleaned invalid classes and CSS variables on 2025-11-12 using slds-plus.css as source of truth.'
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |