npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@audius/harmony

v0.4.3

Published

The Audius Design System

Readme

Docs

Full documentation can be found here: Harmony Docs

Installation

Install @audius/harmony:

npm install --save @audius/harmony

Due to an issue with react-virtualized, if using vite you must also install a plugin to fix the build: https://www.npmjs.com/package/esbuild-plugin-react-virtualized

npm install --save-dev esbuild-plugin-react-virtualized

Follow the instructions to add the plugin to your vite config:

// vite.config.js
import { defineConfig } from 'vite'
import fixReactVirtualized from 'esbuild-plugin-react-virtualized'

export default defineConfig({
  optimizeDeps: {
    esbuildOptions: {
      plugins: [fixReactVirtualized]
    }
  }
})

For more information, see: https://github.com/bvaughn/react-virtualized/issues/1722

Setup

Import styles exported by Harmony

import '@audius/harmony/dist/harmony.css'

Setup the ThemeProvider exported by Harmony

import { ThemeProvider as HarmonyThemeProvider } from '@audius/harmony'

const App = () => {
  return <HarmonyThemeProvider theme='day'>...</HarmonyThemeProvider>
}

In order use emotion yourself, follow their documentation for setting up the css-prop

If using typescript you will need to:

  1. Add an emotion.d.ts file and include the following for access to harmony's theme type
import '@emotion/react'
import type { HarmonyTheme } from '@audius/harmony'

declare module '@emotion/react' {
  export interface Theme extends HarmonyTheme {}
}
  1. Update your tsconfig to specify the jsxImportLocation:
{
  "compilerOptions": {
    "jsxImportSource": "@emotion/react",
    ...
  }
}

Usage

import { Button, Flex } from '@audius/harmony'

const App = () => {
  return (
    <Flex gap='m'>
      <Button variant='secondary'>Click This!</Button>
      <Button>Click That!</Button>
    </Flex>
  )
}

Development

Run storybook (docs site):

npm run storybook

Contribution

A Contribution Guide is available here.

Responsive Design

Harmony includes utilities to help build responsive designs consistently across the application.

Breakpoints

The breakpoints module provides standardized screen size breakpoints and media query helpers:

import { breakpoints } from '@audius/harmony'

// Access specific breakpoint values
const tabletWidth = breakpoints.values.md // 1024

// Use predefined media queries
const mobileQuery = breakpoints.down.sm // (max-width: 768px)
const desktopQuery = breakpoints.up.md // (min-width: 1025px)
const tabletQuery = breakpoints.between.sm_md // (min-width: 769px) and (max-width: 1024px)

// Create custom media queries
const customQuery = breakpoints.createCustomQuery(500, 800) // (min-width: 500px) and (max-width: 800px)

useMedia Hook

For reactive responsive designs, use the useMedia hook:

import { useMedia } from '@audius/harmony'

const MyComponent = () => {
  const {
    // Common device categories
    isMobile, // <= 768px
    isTablet, // > 768px and <= 1024px
    isDesktop, // > 1024px

    // Detailed breakpoint checks
    isExtraSmall, // <= 480px
    isSmall, // <= 768px
    isMedium, // <= 1024px

    // Check custom queries
    matchesQuery
  } = useMedia()

  return (
    <div>
      {isMobile && <MobileLayout />}
      {isTablet && <TabletLayout />}
      {isDesktop && <DesktopLayout />}

      {/* Check a custom query */}
      {matchesQuery('(orientation: portrait)') && <PortraitContent />}
    </div>
  )
}

createResponsiveStyles Utility

For more maintainable responsive styling with Emotion, use the createResponsiveStyles utility:

import { useMedia, createResponsiveStyles } from '@audius/harmony'

const MyComponent = () => {
  const media = useMedia()
  const { spacing } = useTheme()

  // Define styles for different breakpoints
  const styles = createResponsiveStyles(media, {
    // For a single element
    container: {
      base: {
        padding: spacing.l,
        display: 'flex'
      },
      mobile: {
        padding: spacing.m,
        flexDirection: 'column'
      },
      tablet: {
        padding: spacing.l,
        flexDirection: 'row',
        flexWrap: 'wrap'
      }
    },

    // Include multiple elements in one call
    header: {
      base: { fontSize: '24px' },
      mobile: { fontSize: '18px' }
    },

    // Use functions for complex conditional logic
    content: {
      base: { marginTop: spacing.m },
      mobile: (currentMedia) => ({
        // isExtraSmall is for phones (≤ 480px)
        ...(currentMedia.isExtraSmall && {
          marginTop: spacing.s,
          fontSize: '14px'
        })
      })
    }
  })

  return (
    <div css={styles.container}>
      <h1 css={styles.header}>Title</h1>
      <div css={styles.content}>Content</div>
    </div>
  )
}

The utility applies styles in this order, with later ones overriding earlier ones:

  1. Base styles (always applied)
  2. Mobile styles (if screen width ≤ 768px)
  3. Tablet styles (if 768px < width ≤ 1024px)
  4. Desktop styles (if width > 1024px)

This approach improves maintainability by:

  • Grouping related styles by component part
  • Keeping responsive logic out of JSX
  • Making breakpoint-specific styles easy to locate and update

Using *.styles.ts Files for Organization

For complex components with many responsive styles, it's beneficial to extract the styles into a separate file:

// Button.styles.ts
import { createResponsiveStyles, useMedia } from '@audius/harmony'

type MediaContext = ReturnType<typeof useMedia>

export const getButtonStyles = (
  media: MediaContext,
  spacing: Record<string, string | number>
) => {
  return createResponsiveStyles(media, {
    container: {
      base: { display: 'flex', padding: spacing.m },
      mobile: { flexDirection: 'column' }
    }
    // More styles...
  })
}

// Button.tsx
import { getButtonStyles } from './Button.styles'

export const Button = () => {
  const media = useMedia()
  const { spacing } = useTheme()

  // Import styles from separate file
  const styles = getButtonStyles(media, spacing)

  return <div css={styles.container}>{/* Component content */}</div>
}

This pattern:

  • Keeps component logic and style definitions separate
  • Makes the component file more readable
  • Promotes reusability of styles
  • Makes it easier to maintain complex responsive UIs