# Custom action buttons

You can add your custom buttons in the table by **`actions`** props and listen for their events in your component.

## Example

{% code title="CustomActionButtonExample.vue" %}

```javascript
<template>
    <div id="app">
        <vue-bootstrap4-table :rows="rows" 
                                :columns="columns" 
                                :config="config"
                                :actions="actions"
                                @on-download="onDownload">
        </vue-bootstrap4-table>
    </div>
</template>

<script>
    import VueBootstrap4Table from 'vue-bootstrap4-table'

    export default {
        name: 'App',
        data: function() {
            return {
                rows: [
                ...
                ],
                columns: [
                ...
                ],
                actions: [
                    {
                        btn_text: "Download",
                        event_name: "on-download",
                        class: "btn btn-primary my-custom-class",
                        event_payload: {
                            msg: "my custom msg"
                        }
                    }
                ],
                config: {
                    ...
                }
            }
        },
        methods: {
            onDownload(payload) {
                console.log(payload);
            }
        },
        components: {
            VueBootstrap4Table
        }
    }
</script>
```

{% endcode %}

Each action object should contain the below attributes.

## Attributes details <a href="#attributes-details" id="attributes-details"></a>

| Attributes     | Description                                                | type   | Default   |
| -------------- | ---------------------------------------------------------- | ------ | --------- |
| btn\_name      | Display name for the button                                | String | " "       |
| event\_name    | Name of the event that you want to listen back (Mandatory) | String | undefined |
| class          | Class which you want to override default button classes    | String | " "       |
| event\_payload | Payload you want to send with the event                    | Any    | undefined |


---

# Agent Instructions: 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:

```
GET https://rubanraj54.gitbook.io/vue-bootstrap4-table/1.1.4/custom-action-buttons.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
