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

@alveole/theme

v0.43.3

Published

Shared theme tokens and utilities.

Downloads

4,681

Readme

@alveole/theme

Thème partagé (tokens, typographies, helpers) pour les apps React Native / web.

Installation

npm i @alveole/theme

Peer deps requis : react, react-native, expo-font, expo-system-ui, @tamagui/core.

Utilisation rapide

import { ThemeProvider, useTheme, makeStyles } from '@alveole/theme';

export default function App() {
  return (
    <ThemeProvider>
      <Screen />
    </ThemeProvider>
  );
}

function Screen() {
  const { spacing } = useTheme();
  return <Box style={{ margin: spacing('2W') }}>Contenu</Box>;
}

Générer des styles

// Exemple.styles.tsx
import { makeStyles } from '@alveole/theme';

export const useStyles = makeStyles(({ spacing, text, color }) => ({
  container: { padding: spacing('3W') },
  title: text.Titres['H3 - MD'],
  label: { color: color.Neutre[700] },
}));
// Exemple.tsx
import { useStyles } from './Exemple.styles';

function Exemple() {
  const styles = useStyles();
  return <Box style={styles.container} />;
}

Spacing

Les clés de spacing suivent une nomenclature V (verticals, multiples de 2px) et W (horizontals, multiples de 8px) :

| Clé | px | | ------ | --- | | 0V | 0 | | 0,5V | 2 | | 1V | 4 | | 1,5V | 6 | | 1W | 8 | | 3V | 12 | | 2W | 16 | | 3W | 24 | | 4W | 32 | | 5W | 40 | | 6W | 48 | | 8W | 64 | | 12W | 96 | | 15W | 120 |

const { spacing, externalPadding } = useTheme();

spacing('3W'); // 24
externalPadding(); // 16 sur mobile, 24 sur desktop

Typographies

Les styles de texte sont organisés en trois catégories :

const { text } = useTheme();

// Titres alternatifs (Barlow Bold)
text['Titres alternatifs'].XS; // 48px
text['Titres alternatifs'].XL; // 80px

// Titres (Inter Bold — tailles adaptées mobile/desktop)
text.Titres['H1 - XL']; // Barlow SemiBold, 40px desktop / 32px mobile
text.Titres['H3 - MD']; // 28px desktop / 24px mobile
text.Titres['H6 - XXS']; // 20px desktop / 18px mobile

// Corps de texte
text['Corps de texte'].SM.Regular; // Inter Regular, 14px
text['Corps de texte'].MD.SemiBold; // Inter SemiBold, 16px
text['Corps de texte'].LG.Medium; // Inter Medium, 18px

Fonts

Les fonts sont chargées automatiquement par ThemeProvider. Deux familles sont disponibles : Inter (corps de texte) et Barlow (titres).

Sur le web, les fonts sont injectées via des @font-face CSS standards (font-family: Inter; font-weight: 500). Sur native, elles utilisent le système expo-font.

const { font } = useTheme();

font['Inter-Regular']; // 'Inter-Regular' (native) ou utilisé via font-weight (web)
font['Barlow-Bold'];

fontStyle helper

Pour créer des styles typés avec la bonne font selon la plateforme :

import { fontStyle } from '@alveole/theme';

const style = {
  ...fontStyle('Inter-Bold'), // { fontFamily: 'Inter', fontWeight: '600' } sur web
  fontSize: 16, // { fontFamily: 'Inter-Bold' } sur native
};

Radius

const { radius } = useTheme();

radius('sm'); // 4
radius('md'); // 6
radius('lg'); // 10
radius('full'); // 99999

Breakpoints & variante

const { variant, isVariant } = useTheme();

variant; // 'mobile' | 'tablet' | 'desktop'
isVariant('mobile'); // boolean

| Variante | Largeur | | --------- | ------------- | | mobile | < 768px | | tablet | 768px – 991px | | desktop | ≥ 992px |

Couleurs

const { color } = useTheme();

color.Neutre[700];
color.Mandarine[50];
color.alpha(color.Neutre[900], 0.5); // 'rgba(55, 58, 63, 0.5)'

Personnaliser la palette

<ThemeProvider
  color={{
    Neutre: { 100: '#F7F7F7' },
    Mandarine: { 50: '#FFF3EA' },
  }}
>
  <App />
</ThemeProvider>

(Recommandé) Vous pouvez définir un fichier alveole.config.js à la racine pour centraliser la surcharge :

const { Colors } = require('@alveole/theme');

/** @type {import('@alveole/theme').Palette} */
const palette = {
  primary: Colors.VertPrairie['sun-475'],

  background: {
    button: {
      primary: {
        default: Colors.VertPrairie['sun-475'],
        hover: Colors.VertPrairie['sun-475-hover'],
      },
    },
  },
};

module.exports = { palette };

// Utiliser dans le provider :
// import config from '@/alveole.config.js';
// <ThemeProvider color={config.palette}>

Variables CSS (web)

Sur le web, ThemeProvider injecte automatiquement des variables CSS pour les couleurs, l'espacement et les fonts :

/* Spacing */
var(--spacing-2W)
var(--spacing-3W)

/* Colors */
var(--color-Neutre-200)
var(--color-Mandarine-50)

Références

  • Typage du thème : src/type/Theme.ts
  • Palette : src/constants/Palette.ts
  • Typographies : src/constants/Typography.ts
  • Spacing : src/constants/Spacing.ts
  • Radius : src/constants/Radius.ts
  • Fonts : src/constants/Font.ts