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

react-native-jdenticon

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-jdenticon

Jdenticon, generated identification avatars, for react native projects

  • 0.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

Jdenticon for React Native

react-native-jdenticon makes it possible to use Jdenticon (an open-source library for generating identity avatars) in React Native projects. It uses react-native-svg as a peer dependency.

Installation

  1. Install react-native-jdenticon with yarn or npm

yarn add react-native-jdenticon --save or npm install react-native-jdenticon --save

  1. Install the peer dependency react-native-svg

yarn add react-native-svg --save or npm install react-native-svg --save

  1. Install the RNSVG dependency for ios.

cd ios/ && pod install

Usage

import React from 'react';
import { View } from 'react-native'
import Jdenticon from 'react-native-jdenticon';

const SampleComponent = () => {

    return (
        <View>
            <Jdenticon
                value={'sample string'}
                size={60} />
        </View>
    )
}

export default SampleComponent;

Configuring and Stylign the icon

You can add a config prop with optionsprovided by Jdenticon's official docs to the <Jdenticon> component.

Sample

import React from 'react';
import { View } from 'react-native'
import Jdenticon from 'react-native-jdenticon';

const SampleComponent = () => {
    const config = {
        saturation: {
            color: 0.7
        }
    };

    const style = {
        padding: 20,
        borderRadius: 50,
        backgroundColor: '#ccc'
    }

    return (
        <View>
            <Jdenticon
                value={'sample string'}
                size={60}
                config={config}
                style={style}
            />
        </View>
    )
}

export default SampleComponent;

Keywords

FAQs

Package last updated on 19 Mar 2020

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