Combobox Edit

Examples

Installation


  rails generate shadcn-ui combobox

Usage

<%= render_combobox [{name:, value:}] do %>
  <%= combobox_trigger do %>
  <% end %>
<% end %>

The Combobox component introduces:

  • app/helpers/components/combobox_helper.rb
  • app/views/components/ui/_combobox.html.erb

The method render_combobox method accepts one mandtory argument, an array of hashes that each have a value and name name.

This componnet is the combination of a popover and a filter.