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

@shopify/react-native-skia

Package Overview
Dependencies
Maintainers
25
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/react-native-skia

High-performance React Native Graphics using Skia

  • 0.1.220
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
139K
decreased by-9.34%
Maintainers
25
Weekly downloads
 
Created

What is @shopify/react-native-skia?

@shopify/react-native-skia is a powerful library for rendering high-performance 2D graphics in React Native applications. It leverages the Skia graphics library to provide a wide range of drawing and animation capabilities, making it suitable for creating complex visual effects, custom UI components, and interactive graphics.

What are @shopify/react-native-skia's main functionalities?

Drawing Shapes

This feature allows you to draw basic shapes like circles, rectangles, and lines. The code sample demonstrates how to draw a blue circle using the Canvas and Circle components.

import { Canvas, Circle, Paint } from '@shopify/react-native-skia';

const MyComponent = () => (
  <Canvas style={{ flex: 1 }}>
    <Circle cx={50} cy={50} r={25} color="blue" />
  </Canvas>
);

Custom Paint Effects

This feature allows you to apply custom paint effects to shapes. The code sample shows how to draw a red rectangle with a custom stroke width using the Paint class.

import { Canvas, Rect, Paint } from '@shopify/react-native-skia';

const MyComponent = () => (
  <Canvas style={{ flex: 1 }}>
    <Rect x={10} y={10} width={100} height={100} paint={new Paint().setColor('red').setStrokeWidth(5)} />
  </Canvas>
);

Animations

This feature supports animations for various properties. The code sample demonstrates how to animate the radius of a circle using the useValue and useTiming hooks.

import { Canvas, Circle, useValue, useTiming } from '@shopify/react-native-skia';

const MyComponent = () => {
  const radius = useValue(25);
  useTiming(radius, { to: 50, duration: 1000 });

  return (
    <Canvas style={{ flex: 1 }}>
      <Circle cx={50} cy={50} r={radius} color="green" />
    </Canvas>
  );
};

Other packages similar to @shopify/react-native-skia

Keywords

FAQs

Package last updated on 18 Nov 2023

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