Popover Edit

Displays rich content in a portal, triggered by a button.

Examples

Installation


  rails generate shadcn-ui popover

Usage

<%= render_popover do %>
  <%= popover_trigger do %>
  <% end %>

  <%= popover_content do %>
  <% end %>
<% end %>

The Popover component introduces:

  • app/helpers/components/popover_helper.rb
  • app/views/components/ui/_popover.html.erb
  • app/javascript/controllers/ui/popover_controller.js

render_popover accepts a block where you call popover_trigger, whose block will be the element that triggers the popover and popover_content whose block will be the content of the popover.