> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/kapishdima/fonttrio/llms.txt
> Use this file to discover all available pages before exploring further.

# getAllMoods

> Get all mood tags used across font pairings

# getAllMoods

Returns an array of all unique mood tags used across all font pairings in the registry.

## Function Signature

```typescript lib/pairings.ts theme={null}
export function getAllMoods(): string[]
```

## Returns

<ResponseField name="moods" type="string[]">
  Array of all unique mood tags across all pairings
</ResponseField>

## Description

The `getAllMoods()` function extracts and returns all unique mood values from the mood arrays of every pairing in the registry. This is useful for building filter UIs, discovering available mood categories, or analyzing the collection.

## Usage Examples

### Basic Usage

```typescript theme={null}
import { getAllMoods } from '@/lib/pairings'

const moods = getAllMoods()
console.log(moods)
// Output: ['minimal', 'modern', 'editorial', 'literary', 'bold', ...]
```

### Build a Filter UI

```tsx theme={null}
import { getAllMoods } from '@/lib/pairings'

export function MoodFilter({ onSelect }: { onSelect: (mood: string) => void }) {
  const moods = getAllMoods()
  
  return (
    <div className="flex flex-wrap gap-2">
      {moods.map(mood => (
        <button
          key={mood}
          onClick={() => onSelect(mood)}
          className="px-3 py-1 rounded-md bg-secondary hover:bg-primary"
        >
          {mood}
        </button>
      ))}
    </div>
  )
}
```

### Count Pairings Per Mood

```typescript theme={null}
import { getAllMoods, getPairingsByMood } from '@/lib/pairings'

const moods = getAllMoods()
const moodStats = moods.map(mood => ({
  mood,
  count: getPairingsByMood(mood).length
}))

console.log(moodStats)
// Output: [{ mood: 'minimal', count: 5 }, { mood: 'editorial', count: 8 }, ...]
```

### Generate Mood Tag Cloud

```tsx theme={null}
import { getAllMoods, getPairingsByMood } from '@/lib/pairings'

export function MoodCloud() {
  const moods = getAllMoods()
  
  return (
    <div className="flex flex-wrap gap-3">
      {moods.map(mood => {
        const count = getPairingsByMood(mood).length
        const size = Math.min(20 + count * 2, 36)
        
        return (
          <a
            key={mood}
            href={`/moods/${mood}`}
            style={{ fontSize: `${size}px` }}
            className="hover:underline"
          >
            {mood}
          </a>
        )
      })}
    </div>
  )
}
```

### Validate Mood Input

```typescript theme={null}
import { getAllMoods } from '@/lib/pairings'

function isValidMood(mood: string): boolean {
  const validMoods = getAllMoods()
  return validMoods.includes(mood)
}

// Usage in API route
export async function GET(request: Request) {
  const { searchParams } = new URL(request.url)
  const mood = searchParams.get('mood')
  
  if (mood && !isValidMood(mood)) {
    return Response.json({ error: 'Invalid mood' }, { status: 400 })
  }
  
  // ... rest of handler
}
```

## Common Mood Tags

The registry includes moods such as:

* **Style**: `minimal`, `modern`, `clean`, `brutalist`, `nordic`
* **Tone**: `editorial`, `literary`, `professional`, `friendly`, `playful`
* **Usage**: `structured`, `systematic`, `versatile`, `readable`
* **Character**: `bold`, `impactful`, `sophisticated`, `warm`, `distinctive`

<Note>
  The exact list of moods may change as new pairings are added to the registry. Always call `getAllMoods()` to get the current list.
</Note>

## Related Functions

<CardGroup cols={2}>
  <Card title="getPairingsByMood" icon="filter" href="/api/functions/get-pairings-by-mood">
    Filter pairings by a specific mood tag
  </Card>

  <Card title="getAllPairings" icon="layer-group" href="/api/functions/get-all-pairings">
    Get all available pairings
  </Card>
</CardGroup>

## Notes

* Moods are extracted from the `mood` array field of each pairing
* The function deduplicates moods automatically using a Set
* Returns an array of strings in no particular order
* Empty array is returned only if no pairings exist (should never happen in production)
* Performance: O(n × m) where n is number of pairings and m is average moods per pairing

## Source Reference

Implementation: `lib/pairings.ts:47-51`
