PhlexUI / phlex_ui

Ruby gem for Phlex UI Components
https://phlexui.com/
MIT License
115 stars 11 forks source link

Add Generators Support for PhlexUI #56

Open cirdes opened 1 week ago

cirdes commented 1 week ago

Description

I would like to propose the addition of generators support to the PhlexUI project. This feature, inspired by Shadcn, aims to enhance the gem's customizability by allowing users to copy components into their own applications. Each component can be generated individually or used directly from the gem, providing flexibility and ease of use.

Features

Component Generators:

Direct Usage Option:

Hierarchy and Override Support:

Example Workflow

  1. Generate a Component:

    rails generate phlex_ui:component Button

    This command will copy the Button component to the user's application, ensuring proper references.

  2. Generate All Components:

    rails generate phlex_ui:install

    This command will copy over all components and create an initializer to map the UI namespace.

  3. Use Directly from the Gem: Users can choose to use the components directly from the gem without generating them:

    PhlexUI::Button.new

Benefits