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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@django-bridge/vue

v0.5.0-alpha.1

Published

The simple way to build Django applications with modern Vue frontends

Readme

@django-bridge/vue

The Vue 3 integration for Django Bridge - the simple way to build Django applications with modern Vue frontends.

Installation

npm install @django-bridge/vue vue

Usage

Basic Setup

import { createApp } from 'vue';
import { App, Config } from '@django-bridge/vue';
import './index.css';

import HomeView from './views/Home';
import { CSRFTokenContext } from './contexts';
import FormDef from './adapters/Form';
import FieldDef from './adapters/Field';
import ServerRenderedFieldDef from './adapters/ServerRenderedField';
import TextInputDef from './adapters/widgets/TextInput';
import SelectDef from './adapters/widgets/Select';
import CurrentTimeView from './views/CurrentTimeView';

const config = new Config();

// Add your views here
config.addView('Home', HomeView);

// Add your context providers here (Vue injection keys)
config.addContextProvider('csrf_token', CSRFTokenContext);

// Add your adapters here
config.addAdapter('forms.Form', FormDef);
config.addAdapter('forms.Field', FieldDef);
config.addAdapter('forms.ServerRenderedField', ServerRenderedFieldDef);
config.addAdapter('forms.TextInput', TextInputDef);
config.addAdapter('forms.Select', SelectDef);
config.addView('CurrentTime', CurrentTimeView);

const rootElement = document.getElementById('root')!;
const initialResponse = JSON.parse(
  document.getElementById('initial-response')!.textContent!
);

const app = createApp(App, {
  config,
  initialResponse
});

app.mount(rootElement);

Component Imports

Import components directly from the package:

<script setup>
import { Form, Link } from '@django-bridge/vue';
</script>

<template>
  <Form @submit="handleSubmit">
    <input name="field1" v-model="field1" />
    <Link href="/some-path">Navigate</Link>
    <button type="submit">Submit</button>
  </Form>
</template>

Using Composables

<script setup>
import { useAutoRefresh, useNavigation, useMessages } from '@django-bridge/vue';

// Auto-refresh every 5 seconds
useAutoRefresh(enabled.value, 5000);

// Access navigation - much cleaner than inject!
const navigation = useNavigation();

// Access messages
const { messages, pushMessage } = useMessages();

// Navigate programmatically
const goToDashboard = () => {
  navigation.navigate('/dashboard');
};
</script>

Available Components

  • App - Main application component
  • Form - Django-integrated form component
  • Link - Navigation link component
  • RenderFrame - Frame rendering component

Available Composables

  • useNavigation - Access navigation context (recommended)
  • useMessages - Access messages context (recommended)
  • useAutoRefresh - Auto-refresh functionality
  • useDirtyForm - Dirty form state management
  • useDirtyFormMarker - Dirty form marker
  • useDirtyFormScope - Dirty form scope wrapper

Available Types and Keys

  • Navigation - Navigation interface type
  • Messages - Messages interface type
  • DirtyForm - Dirty form interface type
  • Timer - Timer interface type
  • NavigationKey - Navigation injection key
  • MessagesKey - Messages injection key
  • OverlayKey - Overlay injection key
  • DirtyFormKey - Dirty form injection key

Building for Production

The package includes both CommonJS and ESM builds:

{
  "dependencies": {
    "@django-bridge/vue": "^0.5.0"
  }
}

Development

To build the package:

npm run build

To check types:

npm run check-types

License

BSD-3-Clause