Skip to content

forcedotcom/sf-skills / skills/design-systems-slds-apply

design-systems-slds-apply

Unverified

Apply 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".

FileKindSize
SKILL.mdskill md14.6 KB
assets/README.mdmarkdown2.3 KB
assets/blueprints/components/accordion.yamlconfig15.0 KB
assets/blueprints/components/activity-timeline.yamlconfig3.8 KB
assets/blueprints/components/alert.yamlconfig4.4 KB
assets/blueprints/components/app-launcher.yamlconfig3.8 KB
assets/blueprints/components/avatar-group.yamlconfig3.2 KB
assets/blueprints/components/avatar.yamlconfig3.5 KB
assets/blueprints/components/badges.yamlconfig3.3 KB
assets/blueprints/components/brand-band.yamlconfig12.9 KB
assets/blueprints/components/breadcrumbs.yamlconfig4.0 KB
assets/blueprints/components/builder-header.yamlconfig10.1 KB
assets/blueprints/components/button-groups.yamlconfig3.1 KB
assets/blueprints/components/button-icons.yamlconfig12.9 KB
assets/blueprints/components/buttons.yamlconfig9.4 KB
assets/blueprints/components/cards.yamlconfig4.6 KB
assets/blueprints/components/carousel.yamlconfig6.0 KB
assets/blueprints/components/chat.yamlconfig9.7 KB
assets/blueprints/components/checkbox-button-group.yamlconfig8.3 KB
assets/blueprints/components/checkbox-button.yamlconfig13.8 KB
assets/blueprints/components/checkbox-toggle.yamlconfig7.7 KB
assets/blueprints/components/checkbox.yamlconfig4.4 KB
assets/blueprints/components/color-picker.yamlconfig8.5 KB
assets/blueprints/components/combobox.yamlconfig5.5 KB
assets/blueprints/components/counter.yamlconfig6.6 KB
assets/blueprints/components/data-tables.yamlconfig6.0 KB
assets/blueprints/components/datepickers.yamlconfig6.1 KB
assets/blueprints/components/datetime-picker.yamlconfig7.4 KB
assets/blueprints/components/docked-composer.yamlconfig13.3 KB
assets/blueprints/components/docked-form-footer.yamlconfig6.1 KB
assets/blueprints/components/docked-utility-bar.yamlconfig10.9 KB
assets/blueprints/components/drop-zone.yamlconfig4.5 KB
assets/blueprints/components/dueling-picklist.yamlconfig8.8 KB
assets/blueprints/components/dynamic-icons.yamlconfig5.0 KB
assets/blueprints/components/dynamic-menu.yamlconfig7.7 KB
assets/blueprints/components/expandable-section.yamlconfig4.6 KB
assets/blueprints/components/expression.yamlconfig7.3 KB
assets/blueprints/components/feeds.yamlconfig5.7 KB
assets/blueprints/components/file-selector.yamlconfig6.8 KB
assets/blueprints/components/files.yamlconfig4.8 KB
assets/blueprints/components/form-element.yamlconfig6.1 KB
assets/blueprints/components/global-header.yamlconfig4.7 KB
assets/blueprints/components/global-navigation.yamlconfig4.3 KB
assets/blueprints/components/icons.yamlconfig5.1 KB
assets/blueprints/components/illustration.yamlconfig8.5 KB
assets/blueprints/components/input.yamlconfig5.4 KB
assets/blueprints/components/list-builder.yamlconfig6.2 KB
assets/blueprints/components/lookups.yamlconfig5.8 KB
assets/blueprints/components/map.yamlconfig5.0 KB
assets/blueprints/components/menus.yamlconfig5.5 KB
assets/blueprints/components/modals.yamlconfig6.1 KB
assets/blueprints/components/notifications.yamlconfig3.1 KB
assets/blueprints/components/page-headers.yamlconfig6.0 KB
assets/blueprints/components/panels.yamlconfig6.8 KB
assets/blueprints/components/path.yamlconfig6.4 KB
assets/blueprints/components/picklist.yamlconfig5.2 KB
assets/blueprints/components/pills.yamlconfig5.9 KB
assets/blueprints/components/popovers.yamlconfig4.6 KB
assets/blueprints/components/progress-bar.yamlconfig4.4 KB
assets/blueprints/components/progress-indicator.yamlconfig5.6 KB
assets/blueprints/components/progress-ring.yamlconfig4.0 KB
assets/blueprints/components/prompt.yamlconfig5.5 KB
assets/blueprints/components/publishers.yamlconfig7.0 KB
assets/blueprints/components/radio-button-group.yamlconfig7.3 KB
assets/blueprints/components/radio-group.yamlconfig5.0 KB
assets/blueprints/components/rich-text-editor.yamlconfig6.0 KB
assets/blueprints/components/scoped-notifications.yamlconfig7.6 KB
assets/blueprints/components/scoped-tabs.yamlconfig3.7 KB
assets/blueprints/components/select.yamlconfig4.3 KB
assets/blueprints/components/setup-assistant.yamlconfig8.8 KB
assets/blueprints/components/slider.yamlconfig4.2 KB
assets/blueprints/components/spinners.yamlconfig5.4 KB
assets/blueprints/components/split-view.yamlconfig4.4 KB
assets/blueprints/components/summary-detail.yamlconfig4.1 KB
assets/blueprints/components/tabs.yamlconfig6.1 KB
assets/blueprints/components/textarea.yamlconfig4.6 KB
assets/blueprints/components/tiles.yamlconfig4.0 KB
assets/blueprints/components/timepicker.yamlconfig5.1 KB
assets/blueprints/components/toast.yamlconfig6.5 KB
assets/blueprints/components/tooltips.yamlconfig4.1 KB
assets/blueprints/components/tree-grid.yamlconfig4.9 KB
assets/blueprints/components/trees.yamlconfig4.8 KB
assets/blueprints/components/trial-bar.yamlconfig4.2 KB
assets/blueprints/components/vertical-navigation.yamlconfig5.2 KB
assets/blueprints/components/vertical-tabs.yamlconfig6.9 KB
assets/blueprints/components/visual-picker.yamlconfig6.8 KB
assets/blueprints/components/welcome-mat.yamlconfig5.5 KB
assets/hooks-index.jsonconfig141.1 KB
assets/icon-metadata.jsonconfig919.3 KB
assets/utilities-index.jsonconfig508.6 KB
references/README.mdmarkdown5.8 KB
references/blueprints-index.mdmarkdown9.0 KB
references/checklists.mdmarkdown3.8 KB
references/component-selection.mdmarkdown3.7 KB
references/examples.mdmarkdown8.1 KB
references/icons-decision-guide.mdmarkdown3.8 KB
references/icons-guidance.mdmarkdown6.2 KB
references/overviews/borders.mdmarkdown11.0 KB
references/overviews/color.mdmarkdown12.0 KB
references/overviews/display-density.mdmarkdown18.7 KB
references/overviews/icons.mdmarkdown9.3 KB
references/overviews/illustrations.mdmarkdown10.3 KB
references/overviews/shadows.mdmarkdown7.0 KB
references/overviews/spacing.mdmarkdown9.8 KB
references/overviews/typography.mdmarkdown14.8 KB
references/overviews/utilities.mdmarkdown23.9 KB
references/slds-development-guide.mdmarkdown8.8 KB
references/styling-decision-guide.mdmarkdown9.3 KB
references/styling-hooks/borders.mdmarkdown9.0 KB
references/styling-hooks/color/expressive-palette-hooks.mdmarkdown6.7 KB
references/styling-hooks/color/index.mdmarkdown6.5 KB
references/styling-hooks/color/semantic/accent-hooks.mdmarkdown9.9 KB
references/styling-hooks/color/semantic/feedback-hooks.mdmarkdown33.4 KB
references/styling-hooks/color/semantic/surface-hooks.mdmarkdown17.1 KB
references/styling-hooks/color/system-hooks.mdmarkdown5.8 KB
references/styling-hooks/index.mdmarkdown10.8 KB
references/styling-hooks/shadows.mdmarkdown8.3 KB
references/styling-hooks/spacing.mdmarkdown12.3 KB
references/styling-hooks/typography.mdmarkdown17.8 KB
references/utilities-quick-ref.mdmarkdown3.7 KB
references/utilities/alignment.mdmarkdown3.7 KB
references/utilities/borders.mdmarkdown4.0 KB
references/utilities/box.mdmarkdown4.3 KB
references/utilities/color.mdmarkdown7.7 KB
references/utilities/dark-mode.mdmarkdown3.5 KB
references/utilities/description-list.mdmarkdown5.5 KB
references/utilities/floats.mdmarkdown3.8 KB
references/utilities/grid.mdmarkdown9.7 KB
references/utilities/horizontal-list.mdmarkdown3.7 KB
references/utilities/hyphenation.mdmarkdown2.3 KB
references/utilities/index.mdmarkdown6.6 KB
references/utilities/interactions.mdmarkdown3.1 KB
references/utilities/layout.mdmarkdown3.6 KB
references/utilities/line-clamp.mdmarkdown4.3 KB
references/utilities/margin.mdmarkdown5.2 KB
references/utilities/media-object.mdmarkdown5.3 KB
references/utilities/name-value-list.mdmarkdown4.8 KB
references/utilities/padding.mdmarkdown5.3 KB
references/utilities/position.mdmarkdown5.9 KB
references/utilities/print.mdmarkdown3.0 KB
references/utilities/scrollable.mdmarkdown4.1 KB
references/utilities/sizing.mdmarkdown5.7 KB
references/utilities/themes.mdmarkdown4.0 KB
references/utilities/truncate.mdmarkdown3.7 KB
references/utilities/typography.mdmarkdown4.6 KB
references/utilities/vertical-list.mdmarkdown5.1 KB
references/utilities/visibility.mdmarkdown6.1 KB
scripts/search-blueprints.cjsscript3.6 KB
scripts/search-hooks.cjsscript4.4 KB
scripts/search-icons.cjsscript6.1 KB
scripts/search-utilities.cjsscript5.3 KB

references/examples.md

View on GitHub
# Examples

Worked examples showing the SLDS authoring workflow: from intent to artifact selection.

Each example follows the 5-phase workflow from SKILL.md and shows which files were consulted and why.


## Example 1: Build a Confirmation Dialog

### Phase 1: Understand the Need

- **Pattern:** Confirmation dialog before a destructive action
- **Framework:** LWC
- **States:** Open, confirming (loading), closed

### Phase 2: Select the Artifact

**Check LBC:** `LightningModal` exists in the [Lightning Component Library](https://developer.salesforce.com/docs/component-library/overview/components). Use it.

**Also search blueprints** (for class reference):

```bash
node scripts/search-blueprints.cjs --search "modal"
# Found: Modals (category: Overlay, root: slds-modal)
```

**Read blueprint YAML** for class details: `assets/blueprints/components/modals.yaml`

Key takeaway: `LightningModal` handles the `slds-modal`, `slds-backdrop`, and ARIA attributes automatically. No need to apply blueprint classes manually in LWC.

### Phase 3: Apply Styling

**Read:** `references/styling-decision-guide.md`

The destructive action button needs error color to signal danger:

```bash
node scripts/search-hooks.cjs --prefix "--slds-g-color-error-"
# Found: --slds-g-color-error-1 (#ea001e), --slds-g-color-on-error-1 (#ffffff)
```

**Result:** Use `variant="destructive"` on `lightning-button` inside the modal footer. The LBC handles the correct SLDS color hooks internally.

For the modal body spacing, use utility classes:

```html
<div class="slds-p-around_medium slds-text-align_center">
  <p>Are you sure you want to delete this record?</p>
</div>
```

### Phase 4: Add Icons

**Search:** `node scripts/search-icons.cjs --query "warning"`

```text
Found: utility:warning (score: 100, match: exact)
```

```html
<lightning-icon
    icon-name="utility:warning"
    alternative-text="Warning"
    variant="error"
    size="small"
    class="slds-m-right_x-small">
</lightning-icon>
```

### Phase 5: Validate (checklists.md)

- No hardcoded colors (using LBC variants + hooks)
- Icon has `alternative-text`
- Spacing uses utility classes (`slds-p-around_medium`, `slds-m-right_x-small`)
- No `.slds-*` overrides

---

## Example 2: Styled Card with Status Badge (Non-LWC)

### Phase 1: Understand the Need

- **Pattern:** A card showing a record with a colored status badge
- **Framework:** React (not LWC -- no LBCs available)
- **States:** Active, inactive, pending

### Phase 2: Select the Artifact

**LBC check:** Not applicable (React).

**Search blueprints:**

```bash
node scripts/search-blueprints.cjs --search "card"
# Found: Cards (category: Layout, root: slds-card)

node scripts/search-blueprints.cjs --search "badge"
# Found: Badges (category: Feedback, root: slds-badge)
```

**Read YAMLs:**
- `assets/blueprints/components/cards.yaml` -- classes: `slds-card`, `slds-card__header`, `slds-card__body`, `slds-card__footer`
- `assets/blueprints/components/badges.yaml` -- classes: `slds-badge`, modifiers: `slds-badge_lightest`, `slds-badge_inverse`

### Phase 3: Apply Styling

**Read:** `references/styling-decision-guide.md`

Card background and text use surface hooks. The status is conveyed by badge text plus a custom status accent on the card, rather than invented badge modifiers.

```html
<article class="slds-card my-status-card">
  <div class="slds-card__header slds-grid">
    <header class="slds-media slds-media_center slds-has-flexi-truncate">
      <div class="slds-media__body">
        <h2 class="slds-card__header-title slds-truncate">Account Name</h2>
      </div>
      <div class="slds-no-flex">
        <span class="slds-badge slds-badge_lightest">Active</span>
      </div>
    </header>
  </div>
  <div class="slds-card__body slds-card__body_inner">
    <p>Record details here</p>
  </div>
</article>
```

Custom styling for a subtle card border:

```css
.my-status-card {
  border-left: 3px solid var(--slds-g-color-accent-1, #0176d3);
}
```

Note: custom class uses `my-*` prefix, hook with fallback, no `.slds-*` overrides.

### Phase 4: Add Icons

**Search for a standard object icon:**

```bash
node scripts/search-icons.cjs --query "account" --category "standard"
# Found: standard:account (score: 100, match: exact)
```

In React (non-LWC), use the SVG blueprint pattern:

```html
<span class="slds-icon_container slds-icon-standard-account" title="Account">
  <svg class="slds-icon slds-icon_small" aria-hidden="true">
    <use xlinkHref="/assets/icons/standard-sprite/svg/symbols.svg#account"></use>
  </svg>
  <span class="slds-assistive-text">Account</span>
</span>
```

### Phase 5: Validate

- Card uses exact blueprint classes (`slds-card`, `slds-card__header`, etc.)
- Badge uses a real blueprint modifier (`slds-badge_lightest`), not an invented status variant
- Custom border uses `my-*` prefix and hook with fallback
- Icon uses `slds-assistive-text` for accessibility
- No hardcoded colors

---

## Example 3: Responsive Data Layout with Hooks

### Phase 1: Understand the Need

- **Pattern:** A responsive grid of metric cards
- **Framework:** LWC
- **States:** Loading (spinner), populated, empty (illustration)

### Phase 2: Select the Artifact

**LBC:** `lightning-card` for each metric card. `lightning-spinner` for loading.

**Search for empty state:**

```bash
node scripts/search-blueprints.cjs --search "illustration"
# Found: Illustration (category: Media, root: slds-illustration)
```

### Phase 3: Apply Styling

**Verify grid and spacing utilities** before using them:

```bash
node scripts/search-utilities.cjs --search "slds-grid"
# Found: slds-grid (category: grid, css: display: flex)

node scripts/search-utilities.cjs --search "slds-text-heading_large"
# Found: slds-text-heading_large (category: typography)

node scripts/search-utilities.cjs --search "slds-text-body_small"
# Found: slds-text-body_small (category: typography)
```

**Grid layout** uses utility classes (see `references/utilities-quick-ref.md`):

```html
<div class="slds-grid slds-wrap slds-gutters">
  <template for:each={metrics} for:item="metric">
    <div key={metric.id} class="slds-col slds-size_1-of-1 slds-medium-size_1-of-2 slds-large-size_1-of-3">
      <lightning-card title={metric.label}>
        <div class="slds-p-horizontal_small">
          <p class="slds-text-heading_large">{metric.value}</p>
          <p class="slds-text-body_small slds-text-color_weak">{metric.subtitle}</p>
        </div>
      </lightning-card>
    </div>
  </template>
</div>
```

**Custom metric styling** with hooks:

```css
.my-metric-value {
  font-size: var(--slds-g-font-scale-6, 2rem);
  font-weight: var(--slds-g-font-weight-7, 700);
  color: var(--slds-g-color-on-surface-3, #181818);
}

.my-metric-trend-up {
  color: var(--slds-g-color-success-1, #2e844a);
}

.my-metric-trend-down {
  color: var(--slds-g-color-error-1, #ea001e);
}
```

Note: trend colors use semantic feedback hooks (success/error), not hardcoded green/red.

**Empty state** uses the SLDS illustration blueprint:

```html
<template if:false={hasData}>
  <div class="slds-illustration slds-illustration_small">
    <img src="/img/chatter/Desert.svg" class="slds-illustration__svg" alt="" />
    <div class="slds-text-longform">
      <h3 class="slds-text-heading_medium">No metrics available</h3>
      <p class="slds-text-body_regular">Check back when data is loaded.</p>
    </div>
  </div>
</template>
```

### Phase 4: Add Icons

Trend indicators need icons:

```bash
node scripts/search-icons.cjs --query "arrow up"
# Found: utility:arrowup (score: 100)

node scripts/search-icons.cjs --query "arrow down"
# Found: utility:arrowdown (score: 100)
```

```html
<lightning-icon
    icon-name={metric.trendIcon}
    alternative-text={metric.trendLabel}
    size="xx-small"
    class="slds-m-left_xx-small">
</lightning-icon>
```

### Phase 5: Validate

- Grid uses `slds-grid` + `slds-col` + responsive `slds-*-size_*` classes
- Spacing uses utilities (`slds-p-horizontal_small`, `slds-m-left_xx-small`)
- Typography uses utilities (`slds-text-heading_large`, `slds-text-body_small`)
- Custom CSS uses `my-*` prefix and hooks with fallbacks
- Trend colors use semantic hooks (success/error), not hardcoded values
- Empty state uses SLDS illustration blueprint
- Icons have `alternative-text`
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: 322kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall