Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@klarna/react-native-vector-drawable
Advanced tools
Android vector drawables in React Native.
An alternative to react-native-svg
with 5x faster renders, lighter bundle and built in dark mode support.
yarn add @klarna/react-native-vector-drawable
This library supports React Native New Architecture (aka Fabric). To use this library with your Fabric application, you have to:
@klarna/react-native-vector-drawable
RCT_NEW_ARCH_ENABLED=1 pod install
– this is the same command you run to prepare a Fabric build but you also need to run it after a new native library gets added.newArchEnabled=true
in gradle.properties
file in your project.import VectorDrawable from '@klarna/react-native-vector-drawable';
const Component = () => (
<VectorDrawable
resourceName="ic_drawable_name"
style={{ width: 50, height: 50, tintColor: 'blue' }}
/>
);
Prop | Description | Default |
---|---|---|
resourceName | Name of the Android vector drawable resource. | None |
style | See Style props. Note: border props are not supported. | None |
Prop | Description | Default |
---|---|---|
resizeMode | Determines how to resize the image when the frame doesn't match the raw image dimensions. Possible values are cover , contain , stretch and center | cover |
tintColor | Changes the color of all the non-transparent pixels to the tintColor. | None |
See our guide on contributing.
See our changelog.
Update version in package.json
and merge to master. This will publish the package to NPM, create a draft release on GitHub and a version tag. Edit the release with additional information and publish it.
Copyright © 2022 Klarna Bank AB
For license details, see the LICENSE file in the root of this project.
[0.5.1] - 2024-02-10
FAQs
Android vector drawables in React Native
The npm package @klarna/react-native-vector-drawable receives a total of 4,625 weekly downloads. As such, @klarna/react-native-vector-drawable popularity was classified as popular.
We found that @klarna/react-native-vector-drawable demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.