Skip to content

Server rendered combobox component for Rails

License

Notifications You must be signed in to change notification settings

FlorenceHC/combobox_rails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Combobox Rails

NOTICE: Pre-alpha. This gem in is in progress of being migrated out of a separate repo and needs work before it can be included in other projects.

To make rendering the combobox pattern with a dynamic listbox easy to access and extend.

Features

TODO

Path to being a "Real Gem"

  • Figure out where dependencies live (how does gemspec x Gemfile work?)

  • Reduce dependencies on other gems

    • View component -> other lib to generate HTML (view component is heavy)
    • turbo-rails (can we just use turbo?)
    • stimulus-rails (same here?)
    • sprockets -> propshaft (lighter weight lib)
    • heroicon -> static svgs? options to replace?
  • Clean up the API

    • Ideally this looks a lot like a rails form field, roughly:
    <%= f.combobox :task_id, collection: collection %>
    
    <%= f.combobox :task_id, refresh_url: url, ...options do |combobox| %>
        <%= combobox.with_listbox do |listbox| %>
            <% @tasks.each do |task| %>
                <%= listbox.with_option(id: task.id) do |option| %>
                    ... # rendering option, option to specify how to render selected variant
                <% end %>
            <% end %>
        <% end %>
    <% end %>
  • Migrate tests

  • CI after testing is setup

  • Dependency on specific translations

Usage

How to use my plugin.

Installation

Add this line to your application's Gemfile:

gem "combobox_rails"

And then execute:

$ bundle

Or install it yourself as:

$ gem install combobox_rails

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.

About

Server rendered combobox component for Rails

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published