Button Card Data List Detail Disclosure Divider Field Set Icon Button Icon Icon Select Inline Text Field Label Link Link Select Menu Modal Rich Text Box Section Select Tabs Tag Text Text Field Text Field With Prefix Toggle

Dimsum v2.0.0

An agentic component library for Ruby On Rails.

Open modal
Open modal
Open modal
modal.html.erb Copy snippet Copied!
1
<%= render ModalComponent.new do %>
2
  <p>A modal with no header or footer — just wrapped content.</p>
3
<% end %>
1
<%= render ModalComponent.new do |m| %>
2
  <% m.with_header do |h| %>
3
    <% h.with_tabs do |t| %>
4
      <% t.with_tab(label: "Details", href: "#", selected: true) %>
5
      <% t.with_tab(label: "Activity", href: "#") %>
6
    <% end %>
7
  <% end %>
8
  <p>Any page or content goes here.</p>
9
  <% m.with_footer do |f| %>
10
    <% f.with_action { render ButtonComponent.new(label: "Save", size: "sm", type: "submit") } %>
11
  <% end %>
12
<% end %>
1
<%= render ModalComponent.new do |m| %>
2
  <% m.with_header(title: "Title") %>
3
  <p>Any page or content goes here.</p>
4
  <% m.with_footer do |f| %>
5
    <% f.with_action { render ButtonComponent.new(label: "Save", size: "sm", type: "submit") } %>
6
  <% end %>
7
<% end %>

Modal

A dialog over a dimmed backdrop, inside a Turbo frame. Wrap any content as the body; an optional header (a title or Tabs, plus Close) and footer (actions plus Dismiss) sit above and below. Closes on Escape, a backdrop click, a successful submit, or a Close/Dismiss link.

PropTypeDefault
size One of SIZES — modal width. Only "medium" (480px) for now; the param is the seam for future widths. String "medium"
**html_options Extra HTML attributes for the `.modal` element. Hash —

Slots: footer header

Contains

  • Modal Footer
  • Modal Header