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

react-native-card-modal

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-card-modal

Card modal for react-native projects

  • 1.0.15
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Native Card Modal

Pure JS animated card modal, similar to google maps or many other UI interfaces out there, it is a functional component and uses hooks, so react 16.3 (or whichever version added hooks) is needed.

Install

yarn add react-native-card-modal

Usage

Typescript is there!

Sample code:

import { CardModal } from "react-native-card-modal";

<CardModal
  visible={!!selectedPin}
  onClose={this.onModalClose}
  scrollable
  overlay
>
  <Text style={{ padding: 20, fontSize: 30, fontWeight: "bold" }}>
    Insert your very nice content here
  </Text>
</CardModal>;

Works great with react-native-portal if you want to place stuff in front of your other UI elements

Props

visible: boolean;
scrollable: boolean; // If scrollable you can swipe up to expand the card, an "expanded" prop is passed to the child component so you can render different content
overlay?: boolean; // Puts an overlay behind the card
onClose: () => void; // When clicking on the overlay or the function you can call inside your component
style?: StyleProp<any>;
minHeight?: number; // Small card height
maxHeight?: number; // Expanded card height
hideSnack?: boolean; // Hides the snack indicator, so you can place it inside your component

The child component inside the card will get injected 1 prop: expanded: boolean so you can render content differently when the card is expanded

Contributing

The component is very simple, if you feel like you need to add a prop open a PR and I'll promptly merge it.

Keywords

FAQs

Package last updated on 26 Nov 2019

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