0.4.1 • Published 7 months ago

@expo-google-fonts/nunito-sans v0.4.1

Weekly downloads
236
License
MIT AND OFL-1.1
Repository
github
Last release
7 months ago

@expo-google-fonts/nunito-sans

npm version license publish size publish size

This package lets you use the Nunito Sans font family from Google Fonts in your Expo app.

Nunito Sans

Nunito Sans

This font family contains 16 styles.

  • NunitoSans_200ExtraLight
  • NunitoSans_300Light
  • NunitoSans_400Regular
  • NunitoSans_500Medium
  • NunitoSans_600SemiBold
  • NunitoSans_700Bold
  • NunitoSans_800ExtraBold
  • NunitoSans_900Black
  • NunitoSans_200ExtraLight_Italic
  • NunitoSans_300Light_Italic
  • NunitoSans_400Regular_Italic
  • NunitoSans_500Medium_Italic
  • NunitoSans_600SemiBold_Italic
  • NunitoSans_700Bold_Italic
  • NunitoSans_800ExtraBold_Italic
  • NunitoSans_900Black_Italic

Usage

Run this command from the shell in the root directory of your Expo project to add the font family package to your project

npx expo install @expo-google-fonts/nunito-sans expo-font

Now add code like this to your project

import { Text, View } from "react-native";
import { useFonts } from '@expo-google-fonts/nunito-sans/useFonts';
import { NunitoSans_200ExtraLight } from '@expo-google-fonts/nunito-sans/200ExtraLight';
import { NunitoSans_300Light } from '@expo-google-fonts/nunito-sans/300Light';
import { NunitoSans_400Regular } from '@expo-google-fonts/nunito-sans/400Regular';
import { NunitoSans_500Medium } from '@expo-google-fonts/nunito-sans/500Medium';
import { NunitoSans_600SemiBold } from '@expo-google-fonts/nunito-sans/600SemiBold';
import { NunitoSans_700Bold } from '@expo-google-fonts/nunito-sans/700Bold';
import { NunitoSans_800ExtraBold } from '@expo-google-fonts/nunito-sans/800ExtraBold';
import { NunitoSans_900Black } from '@expo-google-fonts/nunito-sans/900Black';
import { NunitoSans_200ExtraLight_Italic } from '@expo-google-fonts/nunito-sans/200ExtraLight_Italic';
import { NunitoSans_300Light_Italic } from '@expo-google-fonts/nunito-sans/300Light_Italic';
import { NunitoSans_400Regular_Italic } from '@expo-google-fonts/nunito-sans/400Regular_Italic';
import { NunitoSans_500Medium_Italic } from '@expo-google-fonts/nunito-sans/500Medium_Italic';
import { NunitoSans_600SemiBold_Italic } from '@expo-google-fonts/nunito-sans/600SemiBold_Italic';
import { NunitoSans_700Bold_Italic } from '@expo-google-fonts/nunito-sans/700Bold_Italic';
import { NunitoSans_800ExtraBold_Italic } from '@expo-google-fonts/nunito-sans/800ExtraBold_Italic';
import { NunitoSans_900Black_Italic } from '@expo-google-fonts/nunito-sans/900Black_Italic';

export default () => {

  let [fontsLoaded] = useFonts({
    NunitoSans_200ExtraLight, 
    NunitoSans_300Light, 
    NunitoSans_400Regular, 
    NunitoSans_500Medium, 
    NunitoSans_600SemiBold, 
    NunitoSans_700Bold, 
    NunitoSans_800ExtraBold, 
    NunitoSans_900Black, 
    NunitoSans_200ExtraLight_Italic, 
    NunitoSans_300Light_Italic, 
    NunitoSans_400Regular_Italic, 
    NunitoSans_500Medium_Italic, 
    NunitoSans_600SemiBold_Italic, 
    NunitoSans_700Bold_Italic, 
    NunitoSans_800ExtraBold_Italic, 
    NunitoSans_900Black_Italic
  });

  let fontSize = 24;
  let paddingVertical = 6;

  if (!fontsLoaded) {
    return null;
  } else {
    return (
      <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_200ExtraLight"
        }}>
          Nunito Sans Extra Light
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_300Light"
        }}>
          Nunito Sans Light
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_400Regular"
        }}>
          Nunito Sans Regular
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_500Medium"
        }}>
          Nunito Sans Medium
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_600SemiBold"
        }}>
          Nunito Sans Semi Bold
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_700Bold"
        }}>
          Nunito Sans Bold
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_800ExtraBold"
        }}>
          Nunito Sans Extra Bold
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_900Black"
        }}>
          Nunito Sans Black
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_200ExtraLight_Italic"
        }}>
          Nunito Sans Extra Light Italic
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_300Light_Italic"
        }}>
          Nunito Sans Light Italic
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_400Regular_Italic"
        }}>
          Nunito Sans Italic
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_500Medium_Italic"
        }}>
          Nunito Sans Medium Italic
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_600SemiBold_Italic"
        }}>
          Nunito Sans Semi Bold Italic
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_700Bold_Italic"
        }}>
          Nunito Sans Bold Italic
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_800ExtraBold_Italic"
        }}>
          Nunito Sans Extra Bold Italic
        </Text>
        <Text style={{
          fontSize,
          paddingVertical,
          // Note the quoting of the value for `fontFamily` here; it expects a string!
          fontFamily: "NunitoSans_900Black_Italic"
        }}>
          Nunito Sans Black Italic
        </Text>
      </View>
    );
  }
};

🔡 Gallery

NunitoSans_200ExtraLightNunitoSans_300LightNunitoSans_400Regular
NunitoSans_500MediumNunitoSans_600SemiBoldNunitoSans_700Bold
NunitoSans_800ExtraBoldNunitoSans_900BlackNunitoSans_200ExtraLight_Italic
NunitoSans_300Light_ItalicNunitoSans_400Regular_ItalicNunitoSans_500Medium_Italic
NunitoSans_600SemiBold_ItalicNunitoSans_700Bold_ItalicNunitoSans_800ExtraBold_Italic
NunitoSans_900Black_Italic

👩‍💻 Use During Development

If you are trying out lots of different fonts, you can try using the @expo-google-fonts/dev package.

You can import any font style from any Expo Google Fonts package from it. It will load the fonts over the network at runtime instead of adding the asset as a file to your project, so it may take longer for your app to get to interactivity at startup, but it is extremely convenient for playing around with any style that you want.

📖 License

The @expo-google-fonts/nunito-sans package and its code are released under the MIT license.

All the fonts in the Google Fonts catalog are free and open source.

Check the Nunito Sans page on Google Fonts for the specific license of this font family.

You can use these fonts freely in your products & projects - print or digital, commercial or otherwise. However, you can't sell the fonts on their own. This isn't legal advice, please consider consulting a lawyer and see the full license for all details.

🔗 Links

🤝 Contributing

Contributions are very welcome! This entire directory, including what you are reading now, was generated from code. Instead of submitting PRs to this directly, please make contributions to the generator instead.

0.3.0

9 months ago

0.4.1

7 months ago

0.4.0

7 months ago

0.2.3

3 years ago

0.2.2

4 years ago

0.2.0

5 years ago

0.1.0

6 years ago

0.0.2

6 years ago