Registry / web-framework / framework7-react

framework7-react

JSON →
library9.0.3jsnpmunverified

Framework7 React is a wrapper library that integrates the Framework7 mobile UI framework with React, enabling developers to build full-featured iOS and Android applications. It provides React components that correspond to Framework7's extensive set of native-looking UI elements, abstracting away direct DOM manipulation and leveraging React's declarative paradigm. The library is currently stable at version 9.0.3 and maintains a frequent release cadence, with patch and minor updates often released weekly or bi-weekly, and major versions introducing significant UI overhauls, such as the new iOS 26 styles and updated Material You specifications in v9.0.0. Its key differentiators include a rich component library designed to mimic native mobile app aesthetics, seamless integration with Framework7's core APIs (like routing and modals), and strong support for hybrid app development workflows with tools like Cordova and Capacitor, making it a robust choice for PWA and hybrid mobile app projects.

npm install framework7-react
INSTALL
IMPORT
SIG · FRAMEWORK7-REACT
F
framework7-react
web-frameworkjavascriptv9.0.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

App
import { App } from 'framework7-react';
const App = require('framework7-react').App;
The primary component to initialize Framework7. Use named import. CommonJS `require` is generally not recommended for modern React/F7 applications.
Framework7
import { Framework7 } from 'framework7-react';
import Framework7 from 'framework7';
This import from 'framework7-react' provides the TypeScript type and a reference to the global Framework7 instance after initialization. The actual instance becomes accessible via `Framework7.instance` once the `<App>` component mounts and initializes.
f7ready
import { f7ready } from 'framework7-react';
Framework7.instance.ready(() => {});
A utility function specific to `framework7-react` to execute code when the Framework7 instance is fully initialized and ready, ensuring `Framework7.instance` is available. Prefer this over direct Framework7 core methods in a React context.
f7Page, f7Navbar
import { f7Page, f7Navbar } from 'framework7-react';
import { Page, Navbar } from 'framework7-react';
Most Framework7 React components are prefixed with `f7` to avoid naming conflicts and clearly denote their origin. Always use the `f7` prefixed versions when importing components.

Initializes a basic Framework7 React application with a single view and page, demonstrating app setup and component usage, including accessing the Framework7 API.

import React, { useEffect } from 'react'; import { App, View, Page, Navbar, Block, Button, f7ready, Framework7 } from 'framework7-react'; // Framework7 parameters const f7params = { name: 'My F7 React App', theme: 'auto', // Detect iOS or MD theme automatically routes: [ { path: '/', component: () => ( <Page> <Navbar title="Hello F7 React" /> <Block strong> <p>Welcome to a basic Framework7 React application!</p> <p>This demonstrates a simple page with a functional button.</p> <Button fill onClick={() => Framework7.instance?.dialog.alert('Button clicked!')}> Click Me </Button> </Block> </Page> ), }, ], }; const MyApp: React.FC = () => { useEffect(() => { f7ready(() => { console.log('Framework7 instance is ready and accessible via Framework7.instance'); // Example: Framework7.instance.router.navigate('/some-other-page'); }); }, []); return ( <App {...f7params}> {/* Main View for the app */} <View main url="/" /> </App> ); }; export default MyApp; // To render, typically in index.tsx: // import React from 'react'; // import { createRoot } from 'react-dom/client'; // import MyApp from './MyApp'; // import 'framework7/css/bundle'; // Crucial: Import Framework7 styles // // const rootElement = document.getElementById('root'); // if (rootElement) { // createRoot(rootElement).render(<MyApp />); // }
Debug
Known issues
breakingThe `dynamicNavbar` functionality has been completely removed in v9.0.0. Components relying on this feature will break.
fix
Refactor layouts to use static Navbars or implement custom solutions for dynamic header behavior. Review your app's navigation structure for compatibility.
affects: >=9.0.0
breakingIn v9.0.0, the default text for Navbar back links is now empty, favoring an icon-only approach.
fix
If text is required for back links, explicitly set the `backLinkText` prop on `f7Navbar` or `f7Page` components.
affects: >=9.0.0
gotchaVersion 9.0.0 introduces significant UI/UX changes for both iOS (new iOS 26 styles) and Material Design (updated Material You specs, new color schemes). Existing custom styles or themes might require adjustments.
fix
Thoroughly review your application's UI after upgrading. Test components across both iOS and Material Design themes to identify and resolve visual regressions or inconsistencies.
affects: >=9.0.0
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'dialog')
Attempting to access `Framework7.instance` or its methods (e.g., `Framework7.instance.dialog`) before the Framework7 app is fully initialized.
fix
Ensure all calls to `Framework7.instance` or its APIs are placed within the `f7ready()` callback, or inside a `useEffect` hook that depends on `f7ready` having completed, guaranteeing the instance is available.
Module not found: Can't resolve 'framework7-react' in '...' or 'Module not found: Can't resolve 'framework7/css/bundle''
The `framework7-react` package, its core `framework7` dependency, or the required CSS bundle is not installed or incorrectly referenced.
fix
Run `npm install framework7-react framework7 react react-dom` (or `yarn add`). Also, ensure you have `import 'framework7/css/bundle';` (or specific theme CSS) in your root React component or main entry file.
Framework7 components must be used inside Framework7 App component.
A component provided by `framework7-react` (e.g., `f7Page`, `f7Navbar`) is being rendered outside of the main `<App>` component wrapper.
fix
Ensure that all Framework7 React components are direct or indirect children of the `<App>` component provided by `framework7-react` to ensure they have access to the Framework7 context.
Upgrade
Version history
9.0.3latest on npm
Audit
Dependencies
framework7requiredCore UI framework that provides styles, components, and underlying functionality.
reactrequiredThe core library for building user interfaces.
react-domrequiredProvides DOM-specific rendering methods for React applications.
Agent activity
2 hits · last 30 days
node
2
Resources
framework7-react — npm install framework7-react · libregistry