# Plugin vs. theme component

**URL:** https://meta.discourse.org/t/plugin-vs-theme-component/240908
**Category:** Development
**Created:** [October 4, 2022, 4:41pm UTC](https://meta.discourse.org/t/plugin-vs-theme-component/240908 "2022-10-04T16:41:33Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [October 4, 2022, 4:41pm UTC](https://meta.discourse.org/t/plugin-vs-theme-component/240908/1 "2022-10-04T16:41:33Z")

</div>

Continuing the discussion from [Thumbs up, twice](https://meta.discourse.org/t/thumbs-up-twice/240867/4):

Sorry, I didn’t try search — I’m a horrible person.

But if out there is a plugin and a theme component and those do (almost) same thing what is the most important difference between those two?

A plugin needs rebuilding, of course, but is there some other reasons why other is better choice than other?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [October 4, 2022, 4:45pm UTC](https://meta.discourse.org/t/plugin-vs-theme-component/240908/2 "2022-10-04T16:45:47Z")

</div>

First, the Reactions plugin and the change-like-icon theme component do not (almost) do the same thing.

Yes, you can use the Reactions plugin to change the like icon but its main purpose is to offer _multiple_ possible reactions, so its functionality is much broader than only a cosmetic change.

A plugin can do everything a theme component can do, but a theme component can not do everything a plugin can do.

A plugin consists of server-side and client-side code,  
and a theme component consists only on client-side code and has to rely on existing server-side code.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [October 4, 2022, 4:49pm UTC](https://meta.discourse.org/t/plugin-vs-theme-component/240908/3 "2022-10-04T16:49:17Z")

</div>

That’s true between those. I didn’t think that much, being reactive was my middle name today 😂

So — in real world plugins and components do never same things and then the only reason to use this or that is what it serves?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [October 4, 2022, 4:52pm UTC](https://meta.discourse.org/t/plugin-vs-theme-component/240908/4 "2022-10-04T16:52:34Z")

</div>

That is so abstractly worded that the answer is probably ‘yeah’.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 4, 2022, 4:56pm UTC](https://meta.discourse.org/t/plugin-vs-theme-component/240908/5 "2022-10-04T16:56:57Z")

</div>

> [@RGJ](#):
>
> First, the Reactions plugin and the change-like-icon theme component do not (almost) do the same thing.

That’s true, but it seemed from another topic that all he wanted to do was to do what the theme component does and just have a single 👍 rather than a ❤ .

> [@Jagster](#):
>
> So — in real world plugins and components do never same things and then the only reason to use this or that is what it serves?

If you need changes made to Rails (like you need to store or retrieve different data from the database) then you need a plugin.

If you’re changing only the front end (Ember and CSS) then a theme component will do the trick. (A while back, the difference was more nuanced.)

If what you’re doing can be accomplished in Ember only, then a theme component is easier to install since it doesn’t require rebuilding the docker image.

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [October 4, 2022, 9:59pm UTC](https://meta.discourse.org/t/plugin-vs-theme-component/240908/6 "2022-10-04T21:59:34Z")

</div>

I took this to its logical conclusion with [Topic List Previews (TLP)](https://meta.discourse.org/t/topic-list-previews-theme-component/209973).

This used to be a plugin, until some of its functionality was adopted by Core (thumbnails) at which point I was able to put most of its functionality into a Theme Component to give it a bigger audience and an easier install.

I’ve added and kept some advanced features that require changes to the back end in a complimentary plugin.

Another good example here is [Guest Gate Theme Component](https://meta.discourse.org/t/guest-gate-theme-component/225107). This started life as a plugin, but turns out you don’t need it to be, so was reborn as a new Theme Component (plugins predate Theme Components).

There are probably still one or two plugins that could be converted into a Theme Component (I can think of one of the top of my head) … and there are likely to be more candidates as more functionality is added to the core API …

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [October 5, 2022, 2:35pm UTC](https://meta.discourse.org/t/plugin-vs-theme-component/240908/7 "2022-10-05T14:35:32Z")

</div>

This plugin:

> [@Discourse Video Upload Plugin with YouTube and Vimeo](https://meta.discourse.org/t/discourse-video-upload-plugin-with-youtube-and-vimeo/168569):
>
> Note: This plugin is available as a theme component which enables a much easier installation. The plugin in this post is not actively supported, it is recommended to use the theme component : [Video Upload to YouTube and Vimeo using Theme Component](https://meta.discourse.org/t/video-upload-to-youtube-and-vimeo-using-theme-component/170079) Summary: Allows users on a Discourse forum to upload videos to Vimeo and YouTube directly from the Discourse composer. link GitHub: [GitHub - xomads/discourse-video-upload](https://github.com/xomads/discourse-video-upload)arrow_right Install: Follow the [plugin installation guide](https://meta.discourse.org/t/install-a-plugin/19157). Features All…

Was made as a theme component later as well:

> [@Video Upload to YouTube and Vimeo using Theme Component](https://meta.discourse.org/t/video-upload-to-youtube-and-vimeo-using-theme-component/170079):
>
> This new theme component enables video uploads from the Discourse composer to YouTube and Vimeo. For those already familiar with [the plugin I developed recently](https://meta.discourse.org/t/discourse-video-upload-plugin-with-youtube-and-vimeo/168569), the same is now available in this Theme Component which can be added to any theme. This makes for a much easier installation and works in exactly the same way as the plugin. Features All forum members can upload videos to Vimeo or YouTube (admins can choose to enable either or both). Admins can control the view and embed privacy of th…
