# Composer Character Count

**URL:** https://meta.discourse.org/t/composer-character-count/358733
**Category:** Theme component
**Created:** [March 25, 2025, 9:46am UTC](https://meta.discourse.org/t/composer-character-count/358733 "2025-03-25T09:46:19Z")
**Posts on this page:** 7
**Page:** 1

<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: [March 25, 2025, 9:46am UTC](https://meta.discourse.org/t/composer-character-count/358733/1 "2025-03-25T09:46:19Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **Summary** | A Theme Component to simultaneously display count the number of characters typed in the composer as well as the required number to post. Tracks Post body and Topic Title separately. |
| 🛠 | **Repository Link** | [GitHub - merefield/discourse-tc-character-count: A Theme Component to simultaneously count the number of characters typed in the composer as well as the required number to post! · GitHub](https://github.com/merefield/discourse-tc-character-count) |
| 📖 | **Install Guide** | [Installing a theme or theme component](https://meta.discourse.org/t/install-a-theme-or-theme-component/63682) |
| ❤ | **Sponsorship** | Please consider becoming an ongoing [sponsor of my open source work](https://github.com/sponsors/merefield) at a level that suits your or your organisation’s resources and needs to ensure this component gets the maintenance it deserves and continues to work for your site in the future. |

Enjoying this Theme Component? Please ⭐ it on [GitHub](https://github.com/merefield/discourse-tc-character-count)

Install this theme component

 ![A person in a suit points at a poster with text and numbers. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/e/9/f/e9febdcf5c405c82ed32bbbb2c04377757d69850.jpeg)

## Overview

A Theme Component to simultaneously display count the number of characters typed in the composer as well as the required number to post. Two separate displays for Post body and Title.

Provides users information to avoid them failing to Post because they’ve not entered the minimum lengths required by global settings.

You can configure it to make the display disappear once the minimum number of characters has been reached using setting:

 ![The image shows a text editor interface with a partially typed caption "this is a nice helpful..." with formatting options and options to add more topics or tags. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/8/8/7/887780fee32312d6f4345d51d568b0b6289dfca9.png)

## Credits

Originally based on the #official [plugin](https://meta.discourse.org/t/discourse-characters-required/77195), but this is a much simpler install. I have since modernised the code, added additional logic and made the interface language agnostic.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [March 25, 2025, 10:07am UTC](https://meta.discourse.org/t/composer-character-count/358733/2 "2025-03-25T10:07:05Z")

</div>

Does this prevent the post from being posted if it is lower than the minimum? Or does neither the plugin nor this component do that?  
Just curious.

---

<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: [March 25, 2025, 10:07am UTC](https://meta.discourse.org/t/composer-character-count/358733/3 "2025-03-25T10:07:56Z")

</div>

No change to back-end validation. Just a helpful display.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [March 26, 2025, 11:25pm UTC](https://meta.discourse.org/t/composer-character-count/358733/4 "2025-03-26T23:25:57Z")

</div>

You forgot to remove a debug!

> <https://github.com/merefield/discourse-tc-character-count/blob/main/javascripts/discourse/connectors/after-composer-title-input/show-counts.gjs#L19>

---

<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: [March 27, 2025, 4:43am UTC](https://meta.discourse.org/t/composer-character-count/358733/5 "2025-03-27T04:43:25Z")

</div>

Whoops then there is also something wrong with the CI I’ll need to address 😅. I’ll deal.

---

<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: [March 27, 2025, 7:50am UTC](https://meta.discourse.org/t/composer-character-count/358733/6 "2025-03-27T07:50:31Z")

</div>

Both issues resolved:

[https://github.com/merefield/discourse-tc-character-count/pull/3](https://github.com/merefield/discourse-tc-character-count/pull/3)

> [@Shareable linting config in CI, is something missing in checks?](https://meta.discourse.org/t/shareable-linting-config-in-ci-is-something-missing-in-checks/359088/3):
>
> My bad. It was as simple as a missing dot on the .template-lintrc.cjs filename consider using the [GitHub - discourse/discourse-theme-skeleton: Template for Discourse themes · GitHub](https://github.com/discourse/discourse-theme-skeleton) when setting up new theme components … (although for this one, linting was grandfathered)

😅

---

<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: [August 19, 2026, 10:43am UTC](https://meta.discourse.org/t/composer-character-count/358733/7 "2026-08-19T10:43:21Z")

</div>

This has received some update love:

> <https://github.com/merefield/discourse-tc-character-count/pull/4>
>
> Previously, the component's lint tooling lagged behind current theme-skeleton st…andards, and its character-count behavior lacked browser coverage.
> 
> This change adopts the current lint, type, and Ruby tooling, exports the GJS connector explicitly, avoids empty sufficient-count markup, and adds focused and core-feature system coverage verified by 21 passing examples.
