Vuxel: A Vue.js-Inspired UI Framework for Roblox

Vuxel is a component-based UI framework for Roblox inspired by Vue.js, built to simplify UI development and add reactive, declarative capabilities to Roblox UIs. Vuxel introduces reactive state management, computed properties and component templating.

Key Features

  1. Component-Based Architecture: A template system that supports nested components and lifecycle hooks, inspired by Vue.js.
  2. Reactive State Management: Create and manage state variables that automatically update the UI.
  3. Computed Properties: Define dynamic properties that automatically recalculate based on other state values.
  4. Built-In Animation Utilities: Easily animate UI elements using Vuxel’s Tween function, integrated with TweenService.
  5. Global Reference Management: Store and retrieve references to UI components globally, simplifying interaction across components.

Im open for suggestions, made this in a week for fun so don’t expect a polished framework, code exemples and references in the docs below.

Vuxel Module
Vuxel Docs

8 Likes

Not really valuable input from me, but this is genuinely useful & cool since my brain isnt letting me comprehend the docs for Roact & this is just wayy simpler.

Thanks for this absolutely amazing creation.

Wait. The way you have this stuff set up is kinda scuffed.

Why would you have a GitHub repo with a separate branch for the docs just to host the docs on the main branch?
image

I dont think many people are interested in this because of the weird way you have everything set up lol. Its genuinely confusing.

Yep, a third reply. I forgot to say that the model is also off sale, so no one can even use it :sob:

I do not host the docs on the main branch, that is the source code for the docs website. The production is in the gh-pages branch.

Regarding the Module, you can just download it using the download button since I can not publish it due to package distribution rules on roblox.

Thank you for your feedback tho

1 Like

Indeed i cannot. The download button is a browser plugin that relies on the roblox api for grabbing the model data and downloading it. So if your package isnt published, i cant download it.

image

my advice is to just create a github release and put the module and a changelog of some sorts into it, and add a comically large download button to the website

Thanks! Just did that, now the module points to the latest github release with the rbxm file on it. I will continue to update the github and organize it.

3 Likes

Well everything seems to be alright now! Are you looking for any contributors?

I made this as a fun project since I use vue.js daily I tought it would be fun making someting like that for roblox, you can contribute to it if you feel like it and I can review the code and implement it so the framework gets better over time.

1 Like

Vuxel - Version 0.3.0-alpha

Changelog

Vuxel Module

New Features

Context API (self) for Component Referencing

Description: Introduced a self-based context API that allows each component to reference itself and its children directly without needing Vuxel:GetRef.

Usage: Components within a template structure can now access each other by name via self. This allows straightforward access to parent and sibling components, making it easier to handle events, properties, and behaviors within a component hierarchy.

Benefits: This new system reduces reliance on the Vuxel:GetRef function for direct child-to-child or parent-to-child access, significantly cleaning up the code and enhancing readability.

Implementation Details:

The Components.Template function was updated to use self as a table containing references to each named component in the hierarchy.

self is populated by assigning each component to self[component.Name] based on the Name property specified in each template.

Example:

local MyComponentTemplate = {
  Class = "Frame",
  Name = "MainFrame",
  Children = {
    {
      Class = "TextLabel",
      Name = "TitleLabel",
      Text = "Hello, Vuxel!",
    },
    {
      Class = "TextButton",
      Name = "ActionButton",
      Text = "Click Me",
      Events = {
        MouseButton1Click = function(self)
          print("Button clicked:", self.TitleLabel.Text)  -- Accessing sibling component TitleLabel
          self.TitleLabel.Text = "Clicked!"
        end
      }
    }
  }
}

Enhancements

Lifecycle Hooks

Updated Lifecycle hooks (onMounted and onDestroyed) to allow them to be used as props on template-based tables.

Usage: Define lifecycle hooks directly in the Lifecycle property of any component in a template. The lifecycle hooks will automatically execute when the component is mounted or destroyed, respectively.

Available Lifecycle Hooks Props:

  • onMounted: Called after the component has been parented in the hierarchy.
  • onDestroyed: Called just before the component is destroyed.

Example:

local MyComponentTemplate = {
  Class = "Frame",
  Name = "MainFrame",
  Lifecycle = {
    onMounted = function(self)
      print("Mounted:", self.MainFrame)
    end,
    onDestroyed = function(self)
      print("Destroyed:", self.MainFrame)
    end
  },
  Children = {
    {
      Class = "TextLabel",
      Name = "TitleLabel",
      Text = "Lifecycle Demo"
    }
  }
}

Automatic Template Wrapping in Vuxel.CreateApp

Vuxel.CreateApp now accepts either a raw template structure or a templated component and will automatically wrap it using Vuxel.Template if needed. This will warn, it is better practice to use Vuxel.Template before Vuxel.CreateApp! See Utility.CreateApp(UIFrame) on the vuxel docs!

Summary of Benefits

  • Improved Readability and Maintainability: The new self context API simplifies component referencing, leading to cleaner, more readable code without needing frequent GetRef calls.
  • Enhanced Modularity: Lifecycle hooks props enable allow for quicker declaration within the table based templates.
  • Fallback Developer Experience: Automatically handleVuxel.Template calls within CreateApp in case CreateApp is called on a non templated table.

i know you don’t wanna hear this but your input is very invaluable

2 Likes

I understand fusion and roact already exist and have better documentation / more features but, as I said, I made this for fun and wanted to share it so other developers could use it if they find it less complicated then other existing frameworks.

Vuxel 0.3.1-alpha - Changelog

Enhancements

Optional screenGui parameter on Vuxel.CreateApp

Vuxel.CreateApp now accepts a screenGui parameter, this can be used to parse an already existing screenUI or different types, for exemple, a surfaceGUI instance. If screenGui is not passed, then it will create one for you. Passed screenGui’s will still get an added reference as “root”.

See more at the Vuxel Docs.

Vuxel 0.3.2 - Changelog

Decided to split vuxel in to two repositories, one with the docs and one with the actual releases. Also changed ownership to an organization.

Vuxel
Vuxel-Docs

Rewriten Docs

Rewriten the docs to add more information about the API, added Parameters and Return information for all functions. Also added new Component Properties and Component Structure pages.

New styling

From the docs: “The Style module is used to re-create CSS way of styling UI components with scoped, global and reusable class-based styles.”

Example:

{
    Class = "Frame",
    Name = "StyledFrame",
    Style = {
        BackgroundColor3 = Color3.new(0.5, 0.5, 0.5),
        BorderSizePixel = 2
    }
}

That’s it for 0.3.2!

I think Vide has a more succint syntax and is easier to understand/use. What benefits does Vuexel bring that competitors like Vide / Fusion / React Lua don’t already offer?

2 Likes

As I said above, I made this for fun and wanted to share it so other developers could use it. I find Fusion syntax very anoying and I manly code LUA on roblox studio, not using rojo so React Lua is not a possibility for me. I have never heard of Vide but after searching it does seem a good alernative to Fusion’s syntax.