Skip to main content

Function Signature

function getPairingsByMood(mood: string): PairingData[]

Description

Filters and returns all font pairings that include the specified mood tag. Each pairing can have multiple mood tags, and this function returns all pairings where the specified mood appears in the mood array. Mood tags describe the aesthetic feeling and personality of a font pairing, such as “minimal”, “professional”, “playful”, “elegant”, etc.

Parameters

mood
string
required
The mood tag to filter by. Common mood values include:
  • "minimal" - Clean, uncluttered aesthetic
  • "professional" - Business-appropriate and formal
  • "nordic" - Scandinavian-inspired simplicity
  • "structured" - Organized and geometric
  • "playful" - Fun and creative
  • "elegant" - Refined and sophisticated
Mood matching is case-sensitive and must match exactly.

Return Value

return
PairingData[]
An array of font pairings that contain the specified mood tag. Returns an empty array if no pairings match the mood.Each PairingData object contains:

Usage Examples

import { getPairingsByMood } from '@/lib/pairings';

const minimalPairings = getPairingsByMood('minimal');

console.log(`Found ${minimalPairings.length} minimal pairings`);
minimalPairings.forEach(p => {
  console.log(`- ${p.name}: ${p.heading} + ${p.body}`);
});

Example Response

[
  {
    "name": "agency",
    "heading": "Schibsted Grotesk",
    "headingCategory": "sans-serif",
    "body": "Karla",
    "bodyCategory": "sans-serif",
    "mono": "Fira Code",
    "mood": ["minimal", "nordic"],
    "useCase": ["agency", "design", "portfolio"],
    "description": "Nordic minimalism meets grotesque warmth. Schibsted Grotesk's Scandinavian clarity in headlines paired with Karla's quirky grotesque personality for body text that feels human.",
    "scale": {
      "h1": {
        "size": "2.25rem",
        "weight": 700,
        "lineHeight": "1.15",
        "letterSpacing": "-0.03em"
      },
      "body": {
        "size": "1rem",
        "lineHeight": "1.6",
        "weight": 400
      }
    },
    "googleFontsUrl": "https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;600;700&family=Karla:wght@400;500;600&family=Fira+Code:wght@400;500&display=swap"
  }
]

Notes

Multiple Moods: Each pairing can have multiple mood tags. A pairing tagged with ["minimal", "nordic"] will be returned when searching for either “minimal” or “nordic”.
Case Sensitivity: Mood matching is case-sensitive. "Minimal" will not match "minimal". Always use lowercase mood values as defined in the registry.
Use the getAllMoods() function to get a complete list of available mood tags in the registry.
Performance: This function filters the entire pairings array on each call. For frequently accessed mood filters in production, consider caching the results.

Build docs developers (and LLMs) love