# Top Menu Logout Button Theme Component

**URL:** <https://meta.discourse.org/t/top-menu-logout-button-theme-component/308492>\
**Category:** Development\
**Created:** [May 17, 2024, 10:35pm UTC](https://meta.discourse.org/t/top-menu-logout-button-theme-component/308492 "2024-05-17T22:35:15Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![denvergeeks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/denvergeeks/32/327671_2.png) [@denvergeeks](https://meta.discourse.org/u/denvergeeks)\
**Post date:** [May 17, 2024, 10:35pm UTC](https://meta.discourse.org/t/top-menu-logout-button-theme-component/308492/1 "2024-05-17T22:35:15Z")

</div>

I’ll roll up and post a Theme Component on GitHub for adding a Logout button to the top menu if someone could please let me know how to update @pfaffman’s code here…

> [@Add logout button to top menu](https://meta.discourse.org/t/add-logout-button-to-top-menu/143250/5):
>
> I got it! I won’t promise that it’ll work for you, but this might do it for you. This is common/header.html \<script type="text/discourse-plugin" version="0.8"\> const { iconNode } = require("discourse-common/lib/icon-library"); const { logout } = require("discourse/lib/logout"); api.decorateWidget("header-buttons:before", helper =\> { if (!Discourse.User.current()) return; currentUser = Discourse.User.current(); let container = api.container, lo…

🙏 🙏 🙏

(At the moment following those instructions and enabling the component only makes the entire Top Menu disappear 😿 )

---

_[View the full topic](https://meta.discourse.org/t/top-menu-logout-button-theme-component/308492)._
