- Accordion
- Alert
- Avatar PRO
- Avatar Group PRO
- Badge
- Blank Slate PRO
- Breadcrumb
- Breakpoint Debug PRO
- Button
- Button Group
- Callout PRO
- Card
- Carousel
- Close Button
- Container
- Copy to Clipboard PRO
- Divider PRO
- Dropdown
- Errors PRO
- Feed PRO
- Flash PRO
- Form Field PRO
- Header PRO
- Heading
- Heading with Anchor PRO
- List Group
- Modal
- Nav
- Navbar
- Offcanvas
- Pagination
- Pricing Panel PRO
- Progress
- Progress Circular PRO
- Rating Group PRO
- Ribbon PRO
- Spinner
- Stat PRO
- Stepper PRO
- Table
- Table of Contents PRO
- Team Member PRO
- Testimonial PRO
- Toast
Modal
Description
Create dynamic overlays that display content or prompts within a website.
FREE
This component is available for free.
It implements the Bootstrap Modal component.
See the installation instructions below for more details.
Arguments
Name | Default | Type | Description |
---|---|---|---|
size
|
String
|
Specify the modal size
Options: xl , lg , sm
|
|
fade
|
true
|
Boolean
|
Use fade animation in open |
html_attributes
|
{}
|
Hash
|
Any attributes for the used html wrapper tag |
Examples
Default
<%= render Railsboot::ModalComponent.new(class: "position-static d-block show") do |modal| %>
<% modal.with_header do %>
<h5 class="modal-title">Modal title</h5>
<% end %>
<% modal.with_body do %>
<p>Modal body text goes here.</p>
<% end %>
<% modal.with_footer do %>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
<% end %>
<% end %>
<div class="modal fade position-static d-block show" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button data-bs-dismiss="modal" class="btn-close" aria-label="Close" type="button"></button>
</div>
<div class="modal-body">
<p>Modal body text goes here.</p>
</div>
<div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>