Combobox Edit
Examples
Ruby on Rails
Next.js
Remix.run
<% items = [{:value => "Ruby on Rails", name: "Ruby on Rails"}, {:value => "Next.js", name: "Next.js"}, {:value => "Remix.run", name: "Remix.run"}] %>
<%= render_combobox items do %>
<%= combobox_trigger do %>
Select framework
<% end %>
<% end %>
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.