Close Button

Description

Provide a standardized visual element for dismissing or closing alerts, modals, or other user interface elements.

FREE
This component is available for free. It implements the Bootstrap Close Button component. See the installation instructions below for more details.

Arguments

Name Default Type Description
disabled Boolean Define disabled state of the button
html_attributes {} Hash Any attributes for the used html wrapper tag

Examples

Default

<%= render Railsboot::CloseButtonComponent.new %>
<button class="btn-close" aria-label="Close"></button>

Disabled

<%= render Railsboot::CloseButtonComponent.new(disabled: true) %>
<button class="btn-close" aria-label="Close" disabled="disabled"></button>

Installation

Simply download this component with all its related files and assets. Unpackage the downloaded ZIP-file, copy all relevant files into your app and adapt the things you need. The ZIP-folder contains:

  • A parent component class (app/components/railsboot/component.rb) of which all components inherit from.
  • A base component class (app/components/railsboot/base_component.rb) which is used for rendering internally.
  • The desired component itself (app/components/railsboot/close_button_component.rb).
  • A view template (app/components/railsboot/close_button_component.html.erb) for the component unless it's rendered inline.
  • Any other dependent components such as Slots (just if the component needs those)
  • Any dependent assets (JS-Files, CSS-Files) (just if the component needs those)
  • A test file for the components (test/components/railsboot/close_button_component_test.rb) including potential slot or dependency tests.

For more information please refer to the installation section.

Download

Download the component and its related files (e.g. templates, assets, slots etc.), unpackage the zip file and adapt the things you need.