> For the complete documentation index, see [llms.txt](https://docs.matestack.io/matestack-ui-core/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-core/1.5.0/components-api/core-components/button.md).

# Button

The HTML `<button>` tag, implemented in Ruby.

## Parameters

This component can handle various optional configuration params and can either yield content or display what gets passed to the `text` configuration param.

### Disabled (optional)

Expects a boolean to specify a disabled `<button>` tag. Defaults to `false`, so if not specified otherwise buttons are **not disabled**.

### Text (optional)

Expects a string with the text that should go inside the `<button>` tag.

### HMTL attributes (optional)

This component accepts all the canonical [HTML global attributes](https://www.w3schools.com/tags/ref_standardattributes.asp) like `id` or `class`.

## Examples

### Example 1: Render options\[:text] param

```ruby
button text: 'Click me'
```

returns

```markup
<button>Click me</button>
```

### Example 2: Yield a given block

```ruby
button id: 'foo', class: 'bar' do
  plain "Click me"
end
```

returns

```markup
<button id="foo" class="bar">Click me</button>
```

### Example 3: Using the options\[:disabled] configuration

```ruby
button disabled: true, text: 'You can not click me'
button disabled: false, text: 'You can click me'
button text: 'You can click me too'
```

returns

```markup
<button disabled="disabled">You can not click me</button>
<button>You can click me</button>
<button>You can click me too</button>
```
