# 'Custom Post Button' Theme Component

**URL:** https://meta.discourse.org/t/custom-post-button-theme-component/410782
**Category:** Theme component
**Created:** [August 24, 2026, 1:13pm UTC](https://meta.discourse.org/t/custom-post-button-theme-component/410782 "2026-08-24T13:13:57Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![pacharanero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pacharanero/32/500583_2.png) [@pacharanero](https://meta.discourse.org/u/pacharanero)
#### Post date: [August 24, 2026, 1:13pm UTC](https://meta.discourse.org/t/custom-post-button-theme-component/410782/1 "2026-08-24T13:13:57Z")

</div>

| | | |
| --- | --- | --- |
| 📄 | **Summary** | **Discourse Custom Post Button** turns links inside Discourse posts into styled buttons. |
| 🛠 | **Repository** | [github.com/koloki-co/discourse-custom-post-button](https://github.com/koloki-co/discourse-custom-post-button) |
| ❓ | **Install guide** | [Installing a theme or theme component](https://meta.discourse.org/t/installing-a-theme-or-theme-component/63682) |
| 📚 | **New to Discourse themes?** | [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

Install this theme component

> This is a community theme component maintained by [Koloki Ltd](https://koloki.co/). It is not an official Discourse component. It’s in alpha, so there could be bugs. Please report bugs and request features in the [GitHub repository](https://github.com/koloki-co/discourse-custom-post-button/issues).

## Screenshots

### Buttons

 ![light theme](https://global.discourse-cdn.com/meta/original/4X/d/4/f/d4f55ed1a35722c644975ce0c663536b4d19c15d.png)  
 ![dark theme](https://global.discourse-cdn.com/meta/original/4X/4/9/2/49209ba6fb8a0689685d0b298c7f433b1738c201.png)

### A specific use case: an ‘Ask us a question by PM’ Button

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/2/7/727194d421d9f14dbcc74047cd73a3685d60c3d4.png)

## Features

- Turns a normal link into a button anywhere in a topic or post using `[wrap]`.
- Provides TC-level configurable default background colour, border radius, padding, font weight, text colour, and hover opacity, otherwise uses your site defaults.
- Allows an _individual_ button to override the default background colour.
- Supports explanatory text alongside a button.
- Keeps the underlying content as a normal link, so buttons can open external pages or internal Discourse routes such as `/new-message`.

> **IMPORTANT** : If this TC is installed, **any** user on your forum can create these buttons. To gate the button capability on certain users would require a full Plugin. However, in practice, users need to know it’s installed and how to create a button so I suspect few will actually know how to do it. You **can** also use [Watched Words](https://meta.discourse.org/t/watched-words-reference-guide/241735?tl=en) to filter posts with `[wrap=custom-button]` in them for approval, which would gate the functionality.

## Installation

In **Admin \> Appearance \> Themes & components** , open the **Components** tab, select **Install** , and choose **Install from a Git repository URL**. Use:

```plaintext
https://github.com/koloki-co/discourse-custom-post-button

```

After installation, add the component to each active theme where it should be available.

## Usage

### Basic button

Default button colour from the TC settings will be used

```markdown
[wrap=custom-button][Your Custom Button Text](https://example.com)[/wrap]

```

### Per-button colour setting

```markdown
[wrap=custom-button color=#7CC146][Your Custom Button Text](https://example.com)[/wrap]

```

### Button followed by explanatory text

```markdown
[wrap=custom-button][Your Custom Button Text](https://example.com)[/wrap]
[wrap=text-after-button]Additional explanatory text[/wrap] (on a new line)

```

### Open a private message to a group

(NB: This uses **inbuilt** Discourse functionality to open the Composer with prefilled text - that part of the functionality is not coming from the Theme Component, I’m just using it to demo a possible use case. Requires the Group settings to allow PMs to that group.)

```markdown
[wrap=custom-button][Ask Us a Question](/new-message?groupname=somegroup&title=Aask%20Us&body=Please%20type%20your%20question%20here.)[/wrap]

```

Use the group’s slugified `name` rather than its ‘Full Name’ and URL-encode parameter values. The group’s **Who can message this group?** setting still determines who can open an addressed composer, and signed-out visitors will be asked to log in.

## Settings

| Setting | Purpose |
| --- | --- |
| `button_default_color` | Default button background and border colour |
| `button_border_radius` | Button corner radius |
| `button_padding` | Space around the button label |
| `button_font_weight` | Button label weight |
| `button_text_color` | Button label colour |
| `button_hover_opacity` | Button opacity on hover |

The component also exposes an `svg_icons` setting for available theme icons, but it does not currently insert an icon into a post button. I’ll add that feature if there is demand for it.

## Notes

- The component changes presentation only. Buttons remain links and destination permissions are unchanged.
- Email clients and other contexts that do not load the active Discourse theme may display the underlying link without button styling.
- The component is licensed under the [MIT License](https://github.com/koloki-co/discourse-custom-post-button/blob/main/LICENSE).

The component grew from the same useful `[wrap]` pattern discussed in [How to embed a button into a Topic Post](https://meta.discourse.org/t/how-to-embed-a-button-into-a-topic-post/256473).

---

_[View the full topic](https://meta.discourse.org/t/custom-post-button-theme-component/410782)._
