Use the Stack Sans Notch font family from Google Fonts in your Expo app
npm install @expo-google-fonts/stack-sans-notch!npm version
!license
!publish size
!publish size
This package lets you use the Stack Sans Notch font family from Google Fonts in your Expo app.
This font family contains 6 styles.
- StackSansNotch_200ExtraLight
- StackSansNotch_300Light
- StackSansNotch_400Regular
- StackSansNotch_500Medium
- StackSansNotch_600SemiBold
- StackSansNotch_700Bold
Run this command from the shell in the root directory of your Expo project to add the font family package to your project
``sh`
npx expo install @expo-google-fonts/stack-sans-notch expo-font
Now add code like this to your project
`js
import { Text, View } from "react-native";
import { useFonts } from '@expo-google-fonts/stack-sans-notch/useFonts';
import { StackSansNotch_200ExtraLight } from '@expo-google-fonts/stack-sans-notch/200ExtraLight';
import { StackSansNotch_300Light } from '@expo-google-fonts/stack-sans-notch/300Light';
import { StackSansNotch_400Regular } from '@expo-google-fonts/stack-sans-notch/400Regular';
import { StackSansNotch_500Medium } from '@expo-google-fonts/stack-sans-notch/500Medium';
import { StackSansNotch_600SemiBold } from '@expo-google-fonts/stack-sans-notch/600SemiBold';
import { StackSansNotch_700Bold } from '@expo-google-fonts/stack-sans-notch/700Bold';
export default () => {
let [fontsLoaded] = useFonts({
StackSansNotch_200ExtraLight,
StackSansNotch_300Light,
StackSansNotch_400Regular,
StackSansNotch_500Medium,
StackSansNotch_600SemiBold,
StackSansNotch_700Bold
});
let fontSize = 24;
let paddingVertical = 6;
if (!fontsLoaded) {
return null;
} else {
return (
paddingVertical,
// Note the quoting of the value for fontFamily here; it expects a string!fontFamily
fontFamily: "StackSansNotch_200ExtraLight"
}}>
Stack Sans Notch Extra Light
paddingVertical,
// Note the quoting of the value for here; it expects a string!fontFamily
fontFamily: "StackSansNotch_300Light"
}}>
Stack Sans Notch Light
paddingVertical,
// Note the quoting of the value for here; it expects a string!fontFamily
fontFamily: "StackSansNotch_400Regular"
}}>
Stack Sans Notch Regular
paddingVertical,
// Note the quoting of the value for here; it expects a string!fontFamily
fontFamily: "StackSansNotch_500Medium"
}}>
Stack Sans Notch Medium
paddingVertical,
// Note the quoting of the value for here; it expects a string!fontFamily
fontFamily: "StackSansNotch_600SemiBold"
}}>
Stack Sans Notch Semi Bold
paddingVertical,
// Note the quoting of the value for here; it expects a string!
fontFamily: "StackSansNotch_700Bold"
}}>
Stack Sans Notch Bold
);
}
};
`
||||
|-|-|-|
|!StackSansNotch_200ExtraLight|!StackSansNotch_300Light|!StackSansNotch_400Regular||
|!StackSansNotch_500Medium|!StackSansNotch_600SemiBold|!StackSansNotch_700Bold||
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.
The @expo-google-fonts/stack-sans-notch 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 Stack Sans Notch 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.
- Stack Sans Notch on Google Fonts
- Google Fonts
- This package on npm
- This package on GitHub
- The Expo Google Fonts project on GitHub
- @expo-google-fonts/dev` Devlopment Package
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.