
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@govflanders/vl-ui-design-system-react-native
Advanced tools
All React Native components are bundled in one library and delivered through NPM.
yarn add @govflanders/vl-ui-design-system-react-native
npm install @govflanders/vl-ui-design-system-react-native
yarn add react-native-toast-notifications @react-navigation/native-stack @react-navigation/bottom-tabs @react-navigation/native @react-navigation/native-stack color react-native-vector-icons react-native-modal react-native-render-html react-native-safe-area-context react-native-collapsible @react-navigation/native react-native-linear-gradient @react-native-community/datetimepicker @react-native-community/hooks react-native-document-picker react-native-device-info hyphen date-fns react-native-keyboard-controller react-native-picker-select @react-native-picker/picker
npm install react-native-toast-notifications @react-navigation/native-stack @react-navigation/bottom-tabs @react-navigation/native @react-navigation/native-stack color react-native-vector-icons react-native-modal react-native-render-html react-native-safe-area-context react-native-collapsible @react-navigation/native react-native-linear-gradient @react-native-community/datetimepicker @react-native-community/hooks react-native-document-picker react-native-device-info hyphen date-fns react-native-keyboard-controller react-native-picker-select @react-native-picker/picker
Add a file named react-native.config.js
to the root of your project.
Add the following to this file:
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./node_modules/@govflanders/vl-ui-design-system-react-native/fonts'], // Path to fonts needed to use the package
};
run npx react-native-asset
To use the correct theming + colours we need to wrap everything with the VlUiProvider
and pass a
tenant
object to the context provider.
const tenant = {
tenant: 'Vlaanderen',
colors: {
primary: '#ffe615',
action: '#0055cc',
},
};
<VlUiProvider value={tenant}>...</VlUiProvider>
If you want to use specific colors. Your styles.ts
will should look like this.
import { vlUiTheme } from '@govflanders/vl-ui-design-system-react-native';
import type { VlUiInterface } from '@govflanders/vl-ui-design-system-react-native/src/context/VlUiContext';
import { StyleSheet } from 'react-native';
const styles = (theme: VlUiInterface) => {
const colors = theme.themeAwareColors;
return StyleSheet.create({
title: {
...vlUiTheme.textStyles(theme)['body-xsmall'],
color: colors['vl-annotation-color'],
},
});
};
export { styles };
Your component should look like this.
import {
useThemeAwareObject,
VlUiIconNames,
} from '@govflanders/vl-ui-design-system-react-native';
import { Text, View } from 'react-native';
import { styles as _styles } from './styles';
interface VlUiComponentProps {
title: string;
}
const VlUiComponent = ({ title }: VlUiComponentProps) => {
const styles = useThemeAwareObject(_styles);
return (
<View style={styles.container}>
<Text style={styles.title}>
{title}
</Text>
</View>
);
};
export { VlUiComponent };
If you want to add custom icons to your application, you can generate an iconfont from svg files with fantasticon. Below is the config we're using for the default icon font in the library:
// .fantasticonrc
module.exports = {
name: 'custom-icons-font-name', // Font name
inputDir: './assets/icons', // Path to folder where the .svg icons are located
outputDir: './assets/fonts/iconfont', // Output path where the generated font will be placed
fontTypes: ['ttf'],
assetTypes: ['ts', 'json'],
formatOptions: {
json: {
indent: 2,
},
ts: {
types: ['constant', 'literalId'],
singleQuotes: true,
},
svg: {
centerHorizontally: true,
centerVertically: true,
},
},
normalize: true,
fontHeight: 300,
descent: 150,
pathOptions: {
ts: './assets/iconfont/icon-types.ts', // Path to the folder where you want the generated types to be placed
json: './path/to/generated/glyphmap.json', // Path to the folder where you want the generated glyphMap
},
};
After you generated your custom icon font you should add the output folder of you generated font to
the react-native.config.js
file & link the new assets to you application by running
npx react-native-asset
.
Then, to use custom icons in your application, you can pass iconfont props to the context provider like below.
import glyphs from './path/to/generated/glyphmap.json';
const tenant = {
...,
icons: {
glyphMap: glyphs, // Needed to check if the icon exists in the default or custom icon set
fontFamily: 'custom-icons-font-name', // Needs to be the same name as the one in the fantasticon config
fontFile: 'custom-icons-font-name.ttf', // Needs to be the same name as the one in the fantasticon config with the .ttf extension
}
};
<VlUiProvider value={tenant}>...</VlUiProvider>
After that you can use your custom icons with the provided icon component.
<VlUiIcon name="custom-icon-name" size={16} color={colors['vl-text-color']} style={styles.icon} />
import { VlUiTitle } from '@govflanders/vl-ui-design-system-react-native';
// ...
<VlUiTitle accessibilityLabel="a11y Title content">Title content</VlUiTitle>;
FAQs
test
The npm package @govflanders/vl-ui-design-system-react-native receives a total of 0 weekly downloads. As such, @govflanders/vl-ui-design-system-react-native popularity was classified as not popular.
We found that @govflanders/vl-ui-design-system-react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 19 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.