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

@inertiajs/core

Package Overview
Dependencies
Maintainers
0
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inertiajs/core

A framework for creating server-driven single page apps.

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
114K
increased by70.06%
Maintainers
0
Weekly downloads
 
Created

What is @inertiajs/core?

@inertiajs/core is a JavaScript library that allows developers to build modern single-page applications (SPAs) using classic server-side routing and controllers. It provides a way to create reactive, dynamic web applications without the need for a full client-side framework.

What are @inertiajs/core's main functionalities?

Page Rendering

This feature allows you to render pages using Inertia. The code sample demonstrates how to set up an Inertia app with Vue.js, resolving pages dynamically and mounting them to the DOM.

import { createInertiaApp } from '@inertiajs/core';

createInertiaApp({
  resolve: name => require(`./Pages/${name}`),
  setup({ el, App, props }) {
    new Vue({
      render: h => h(App, props),
    }).$mount(el);
  },
});

Form Handling

Inertia provides a useForm hook to handle form submissions easily. The code sample shows how to create a form object, bind it to form fields, and submit it to a server endpoint with success handling.

import { useForm } from '@inertiajs/core';

const form = useForm({
  name: '',
  email: '',
});

form.post('/submit', {
  onSuccess: () => alert('Form submitted successfully!'),
});

Navigation

Inertia allows for seamless navigation between pages without full page reloads. The code sample demonstrates how to programmatically navigate to a different page using Inertia's visit method.

import { Inertia } from '@inertiajs/core';

function navigateToProfile() {
  Inertia.visit('/profile');
}

Other packages similar to @inertiajs/core

FAQs

Package last updated on 14 Jan 2025

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