Submit
This form component renders A form submit button, styled as a Bootstrap button, implemented in Ruby. Use it like any of the other matestack form components in your apps, pages and components. It offers customizable options to simply achieve what is possible in Bootstrap with this component. See below for more information about the configuration options.

bs_form_submit(*args, &block)

Renders a Bootstrap button that acts as a form submit trigger.
Optional options
  • button_variant - Expects a symbol that defines the Bootstrap style. Defaults to :primary
  • spinner_variant - Expects a symbol that defines the Bootstrap loading spinner style. Defaults to :light, size: :sm
  • text - Expects a string, the content of which get displayed within the button
  • loading_text - Expects a string, the content of which get displayed while the button is in its "loading"-status
  • size - Expects a symbol that defines the Bootstrap button size
  • class - Additional custom CSS class applied to button
  • loading_class - Additional custom CSS class applied to button during submission

Examples

Example 1: Basic usage without any configuration

1
bs_form_submit
Copied!

Example 2: Custom text and loading text

1
bs_form_submit text: "Submit!!", loading_text: "Getting submitted"
Copied!

Example 3: Default texts, custom button and spinner variant

1
bs_form_submit button_variant: :light, spinner_variant: :dark
Copied!

Example 4: Default texts & variants, different size

1
bs_form_submit size: :lg
Copied!

Example 5: Non-default text, loading_text, button_variant, spinner_variant, size plus additional, custom class & loading_class

1
bs_form_submit button_variant: :light, spinner_variant: :dark, class: "custom-submit", loading_class: "custom-submit-loading", size: :lg, text: "Submit!!", loading_text: "Getting submitted"
Copied!
Last modified 4mo ago