pantographe / view_component-form

Rails FormBuilder for ViewComponent
MIT License
204 stars 16 forks source link

Add gem configuration, with base component customization #160

Closed joelzwarrington closed 5 months ago

joelzwarrington commented 5 months ago

What

Why

So that one can define shared logic without having to use concerns or building their own components that don't inherit from their ViewComponent::Form component counterpart.

As an example, let's say I'd like to use the heroicon gem to add icons to my fields, I can do that easily by defining my own ApplicationFormComponent

class ApplicationFormComponent < ViewComponent::Base
  include Heroicon::Engine.helpers
end

or, if I'm using Tailwind, I could use tailwind_merge to merge HTML classes to avoid conflicts, etc.

Spone commented 5 months ago

@joelzwarrington mind adding a note to the CHANGELOG?

joelzwarrington commented 5 months ago

Yep, I'll add a note to the change log 😄