Overview

MV-Components Logo

A MV-Component is a powerful way to write reusable components for your Masonite applications. It provides code reusability and also testability in ways native views just does not allow. A MV-Component is typically comprised of a view file and a python class file.

Why use MV-Components

Reusability

The same MV-Component can be used in various parts of an application without needing to rewrite the same code.

Single Responsibility

Allows complex logic to be stored along with the component that it belongs to instead of scattered across your codebase.

Readability

Makes it easier to reason about the behavior in your templates.

Inspirations

This project is inspired by several projects

  • ViewComponent (Ruby on Rails)

  • Blade Components (Laravel)

Last updated