Matestack Ui Bootstrap
AboutMatestack Ui CoreMatestack Ui VueJsMatestack Ui Bootstrap
2.1
2.1
  • Welcome
  • Getting Started
    • Installation & Update
    • Quick Start [WIP]
  • API
    • Templates
      • Apps
        • Admin App Template
    • Form
      • Checkbox
      • Input
      • Radio
      • Select
      • Submit
      • Switch
    • Components
      • Accordion
      • Alert
      • Badge
      • Breadcrumb
      • Button
      • ButtonGroup
      • Card
      • Carousel
      • Chart
      • Close
      • Collapse
      • Dropdown
      • ListGroup
      • Modal
      • Nav
      • Navbar
      • Pagination
      • Popover
      • Progress
      • Scrollspy
      • Smart collection
      • Spinner
      • Toast
      • Tooltip
    • Layout
      • Container
      • Col
      • Row
  • Integrations
    • Chart.js
    • Flatpickr
    • Devise
Powered by GitBook
On this page
  • bs_form_select(*args, &block)
  • Examples
  • Example 1: Basic usage with array
  • Example 2: Basic usage with hash
  • Example 3: Basic usage with custom class
  • Example 4: Basic usage with label
  • Example 5: Basic usage with placeholder
  • Example 5: Basic usage with form_text
  • Example 6: Basic usage with variant
  1. API
  2. Form

Select

The Bootstrap select menu form component, 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_select(*args, &block)

Renders a Bootstrap form dropdown select menu.

Required options

  • options - Expects an Array or Hash of selectable options

Optional options

  • label - Expects a string, gets displayed before the select menu

  • form_text - Expects a string, gets displayed after the select menu

  • variant - Expects a symbol to change the size of the select menu, you can use either :sm or :lg

Examples

Example 1: Basic usage with array

bs_form_select key: :foo, options: [1, 2, 3]

Example 2: Basic usage with hash

bs_form_select key: :foo, options: { "Option 1": 1, "Option 2": 2, "Option 3": 3 }

Example 3: Basic usage with custom class

bs_form_select key: :foo, options: [1, 2, 3], class: "some-class"

Example 4: Basic usage with label

bs_form_select key: :foo, options: [1, 2, 3], label: "Some label"

Example 5: Basic usage with placeholder

bs_form_select key: :foo, options: [1, 2, 3], placeholder: "select!"

Example 5: Basic usage with form_text

bs_form_select key: :foo, options: [1, 2, 3], form_text: "some notes"

Example 6: Basic usage with variant

bs_form_select key: :foo, options: [1, 2, 3], variant: :lg
PreviousRadioNextSubmit

Last updated 3 years ago