> For the complete documentation index, see [llms.txt](https://docs.matestack.io/matestack-ui-bootstrap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.matestack.io/matestack-ui-bootstrap/api/form/select.md).

# 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

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

### Example 2: Basic usage with hash

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

### Example 3: Basic usage with custom class

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

### Example 4: Basic usage with label

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

### Example 5: Basic usage with placeholder

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

### Example 5: Basic usage with form\_text

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

### Example 6: Basic usage with variant

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.matestack.io/matestack-ui-bootstrap/api/form/select.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
