New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-web-hover

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-web-hover

Some enhanced elements for react-native-web to support hover on the web

0.2.9
latest
Source
npm
Version published
Weekly downloads
1.2K
1.33%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-web-hover

Some enhanced elements for react-native-web to support hover on the web!

ezgif-6-6aca55b7ed39

It requires a React Native version with Pressable support which was introduced in version 0.63

Demo

https://codesandbox.io/s/young-surf-bbmzz?file=/src/App.tsx

Installation

npm install react-native-web-hover

Usage

import { Hoverable, Pressable, } from 'react-native-web-hover'

// The Pressable, you can still provide normal styles or children without functions!
 <Pressable
      style={({ hovered, focused, pressed }) => [
        styles.buttonRoot,
        hovered && styles.buttonHovered,
        focused && styles.buttonFocused,
        pressed && styles.buttonPressed
      ]}
    >
      {({ hovered, focused, pressed }) => (
        <View style={styles.buttonInner}>
          <Text style={styles.buttonLabel}>
            {label}
          </Text>
        </View>
      )}
    </Pressable>

       // The Hoverable
      <Hoverable>
        {({ hovered }) => (
          <Button
            title="legacy button"
            onPress={() => {}}
            color={hovered ? "black" : "grey"}
          />
        )}
      </Hoverable>

We recommend the "Pressable" component. You can see examples here: https://codesandbox.io/s/young-surf-bbmzz?file=/src/App.tsx

If your app is inside an iframe

If your webapp is included in an iframe you will need the FlatList, ScrollViews or VirtualizedList from our library.

import { ScrollView, FlatList, VirtualizedList } from 'react-native-web-hover'

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Keywords

react-native

FAQs

Package last updated on 04 Sep 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