Framework7 Vue

9.0.3 · active · verified Sun Apr 19

framework7-vue is an integration package that bridges the powerful mobile UI components of Framework7 with the reactive capabilities of Vue.js, enabling developers to build full-featured iOS and Android applications. The package is currently at version 9.0.3, released recently with bug fixes for calendar and modal components. Framework7 itself is known for providing native-like UI/UX for both iOS and Material Design themes, and this package wraps those components for seamless use within Vue applications. It maintains a frequent release cadence, primarily focusing on bug fixes and incremental improvements in minor versions, while major versions (like v9.0.0) introduce significant UI/UX overhauls to align with latest platform designs (e.g., iOS 26 styles, Material You) and may include breaking API changes. Its key differentiators include its comprehensive set of pre-built UI components, dedicated themes for iOS and Material Design, and its ability to be used with Cordova or Capacitor for native app packaging.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates a basic Framework7 Vue application. It initializes Framework7, registers the Vue plugin, imports necessary CSS, and sets up a root `f7-app` component with a simple page, navbar, and a button that interacts with the Framework7 dialog API.

import { createApp } from 'vue';
import Framework7 from 'framework7/lite-bundle'; // Import Framework7 core JS
import Framework7Vue from 'framework7-vue'; // Import Framework7 Vue plugin
import 'framework7/framework7-bundle.min.css'; // Import Framework7 styles (includes all themes)

// Initialize Framework7 Vue plugin
Framework7.use(Framework7Vue);

const App = {
  template: `
    <f7-app :params="f7params">
      <f7-view main url="/"></f7-view>
    </f7-app>
  `,
  data() {
    return {
      f7params: {
        name: 'My F7 App',
        theme: 'auto', // Detect iOS or Material theme automatically
        routes: [
          {
            path: '/',
            component: {
              template: `
                <f7-page>
                  <f7-navbar title="Welcome" back-link="Back"></f7-navbar>
                  <f7-block strong>
                    <p>This is a simple Framework7 Vue application.</p>
                    <f7-button fill @click="openAlert">Show Alert</f7-button>
                  </f7-block>
                </f7-page>
              `,
              methods: {
                openAlert() {
                  this.$f7.dialog.alert('Hello from Framework7!');
                }
              }
            }
          }
        ]
      }
    };
  },
  mounted() {
    this.$f7ready((f7) => {
      console.log('Framework7 is ready!', f7);
      // You can now safely use f7 APIs here, e.g., f7.dialog.alert('App mounted!');
    });
  }
};

const app = createApp(App);
app.mount('#app');

view raw JSON →