Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@klarna/react-native-vector-drawable

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@klarna/react-native-vector-drawable

Android vector drawables in React Native

  • 0.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.9K
increased by15.84%
Maintainers
3
Weekly downloads
 
Created
Source

react-native-vector-drawable

Android vector drawables in React Native.

Build Status License Developed at Klarna

An alternative to react-native-svg with 5x faster renders, lighter bundle and built in dark mode support.

Installation

yarn add @klarna/react-native-vector-drawable

Fabric installation

This library supports React Native New Architecture (aka Fabric). To use this library with your Fabric application, you have to:

  1. Add latest @klarna/react-native-vector-drawable
  2. on iOS:
    • Install pods using 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.
  3. on Android:
    • There are no additional steps required so long you app is configured to build with Fabric – this is typically configured by setting newArchEnabled=true in gradle.properties file in your project.

Usage

import VectorDrawable from '@klarna/react-native-vector-drawable';

const Component = () => (
  <VectorDrawable
    resourceName="ic_drawable_name"
    style={{ width: 50, height: 50, tintColor: 'blue' }}
  />
);

Props

PropDescriptionDefault
resourceNameName of the Android vector drawable resource.None
styleSee Style props. Note: border props are not supported.None
Style props
PropDescriptionDefault
resizeModeDetermines how to resize the image when the frame doesn't match the raw image dimensions. Possible values are cover, contain, stretch and centercover
tintColorChanges the color of all the non-transparent pixels to the tintColor.None

How to contribute

See our guide on contributing.

Release History

See our changelog.

Deployment

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.

License

Copyright © 2022 Klarna Bank AB

For license details, see the LICENSE file in the root of this project.

Keywords

FAQs

Package last updated on 10 Feb 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc