npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@brown-bear/react-native-autoheight-webview

v2.0.4

Published

An auto height webview for React Native, even auto width for inline html

Readme

@brown-bear/react-native-autoheight-webview

An auto height webview for React Native, with support for auto width on inline HTML content. This is a fork of the original project iou90.

License: MIT

🚀 Features

  • Auto Height: Automatically adjusts webview height based on content
  • Auto Width: Supports auto width for inline HTML content
  • Cross Platform: Works on both iOS and Android
  • Customizable: Support for custom CSS, JavaScript, and styling
  • Performance Optimized: Efficient size calculation and updates

📦 Installation

This package requires react-native-webview as a peer dependency.

npm install @brown-bear/react-native-autoheight-webview react-native-webview

📖 Usage

import AutoHeightWebView from '@brown-bear/react-native-autoheight-webview'
import { Dimensions } from 'react-native'

<AutoHeightWebView
style={{
width: Dimensions.get('window').width - 15,
marginTop: 35
}}
customScript={document.body.style.background = 'lightyellow';}
customStyle={ * { font-family: 'Times New Roman'; } p { font-size: 16px; } }
onSizeUpdated={size => console.log(size.height)}
files={[{
href: 'cssfileaddress',
type: 'text/css',
rel: 'stylesheet'
}]}
source={{
html: <p style="font-weight: 400;font-style: normal;font-size: 21px;line-height: 1.58;letter-spacing: -.003em;"> Tags are great for describing the essence of your story in a single word or phrase, but stories are rarely about a single thing. <span style="background-color: transparent !important;background-image: linear-gradient(to bottom, rgba(146, 249, 190, 1), rgba(146, 249, 190, 1));"> If I pen a story about moving across the country to start a new job in a car with my husband, two cats, a dog, and a tarantula, I wouldn't only tag the piece with "moving". I'd also use the tags "pets", "marriage", "career change", and "travel tips". </span> </p>
}}
scalesPageToFit={true}
viewportContent={'width=device-width, user-scalable=no'}
// Additional react-native-webview props supported
/>

📱 Demo

Demo |

You can also try the demo project for a full example.

⚙️ API Reference

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | style | ViewStyle | - | Component styling. For iOS text selection issues, reduce width by 15+ and add marginTop 35+ | | customScript | string | - | Custom JavaScript code to inject into the webview | | customStyle | string | - | Custom CSS content added to the page's <head> | | onSizeUpdated | function | - | Callback triggered when height or width changes | | files | FileObject[] | - | Array of local or remote files to include | | source | object | - | WebView source object (HTML, URI, etc.) | | scalesPageToFit | boolean | false | Enable page scaling (differs from react-native-webview default) | | scrollEnabledWithZoomedin | boolean | false | Allow scrolling on iOS when zoomed in | | viewportContent | string | 'width=device-width' (iOS) | Viewport meta tag content | | showsVerticalScrollIndicator | boolean | false | Show vertical scroll indicator | | showsHorizontalScrollIndicator | boolean | false | Show horizontal scroll indicator | | originWhitelist | string[] | ['*'] | Allowed origins for navigation |

FileObject

interface FileObject {
href: string; // File URL or path
type: string; // MIME type (e.g., 'text/css')
rel: string; // Relationship (e.g., 'stylesheet')
}

📋 Requirements

  • React Native >= 0.78
  • react-native-webview >= 13.13.2

📚 Documentation

For earlier versions and migration guides, see the original author's README.

Note: Bug fixes and new features are only included in the latest version.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License.

💝 Support

Support the Original Author (iou90)

Donate

Support This Fork

"Buy Me A Coffee"

🔗 Links


Made with ❤️ by the React Native community