# Custom Component Attributes

**URL:** <https://librepcb.discourse.group/t/custom-component-attributes/938>\
**Category:** Improvement Ideas\
**Created:** [June 19, 2025, 1:12pm UTC](https://librepcb.discourse.group/t/custom-component-attributes/938 "2025-06-19T13:12:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![U.Luke](https://avatars.discourse-cdn.com/v4/letter/u/65b543/32.png) [@U.Luke](https://librepcb.discourse.group/u/U.Luke)\
**Post date:** [June 19, 2025, 1:12pm UTC](https://librepcb.discourse.group/t/custom-component-attributes/938/1 "2025-06-19T13:12:04Z")

</div>

Hi,

I’d like to put custom information in the footprint for an LED.

First, is there any way (or any attribute) to reference the number of copies of that device in the schematic? For example, I’d like to number the LEDs in the chain on the board without the PX prefix (currently using {{NAME}} ).

 ![LED in board chain](https://global.discourse-cdn.com/free1/uploads/librepcb1/original/1X/4a60440895feed7f261a480365a77c4ffcf32758.png)

Secondly, I’d like to add a custom attribute to the footprint that is essentially the number in the chain (i.e. 33) _plus_ some offset number (i.e. 50) specific to the board. Ideally this offset number would be some sort of board attribute and can be referenced with something like {{BOARD\_OFFSET}} ( and in the end look like {{LED\_NUMBER + BOARD\_OFFSET}} ).

Thanks,

Luke

---

<div class="post-metadata">

**Author:** ![ubruhin](https://avatars.discourse-cdn.com/v4/letter/u/c89c15/32.png) [@ubruhin](https://librepcb.discourse.group/u/ubruhin)\
**Post date:** [June 19, 2025, 1:52pm UTC](https://librepcb.discourse.group/t/custom-component-attributes/938/2 "2025-06-19T13:52:13Z")

</div>

Hi,

Huh that’s a very special use-case. I’m afraid but both things are currently not possible.

Honestly I feel an attribute which contains only the number of `{{NAME}}` is too specific to be implemented in LibrePCB. In fact, a name does not necessarily need to consist of letters followed by a number, so such an attribute wouldn’t even work in some cases. I’d simply recommend to put a text label on the board with the hardcoded text “1”, “2”, “3” etc.

The second question _could_ be considered a more generic feature: Supporting arithmetic expressions in attribute evaluation. Still kind of special but I agree it _might_ make sense in some cases. But anyway, it is currently not supported.

The only thing I could imagine as a workaround is to work with string concatenation. E.g. specify a board attribute “LED\_PREFIX” and then put “{{LED\_PREFIX}}1” on the silkscreen to get something like “1.1”, “2.1”, “3.1” etc.

---

<div class="post-metadata">

**Author:** ![ubruhin](https://avatars.discourse-cdn.com/v4/letter/u/c89c15/32.png) [@ubruhin](https://librepcb.discourse.group/u/ubruhin)\
**Post date:** [June 19, 2025, 1:55pm UTC](https://librepcb.discourse.group/t/custom-component-attributes/938/3 "2025-06-19T13:55:48Z")

</div>

EDIT: Ohh I just realized, user-defined attributes are currently not supported on board level. Therefore the “{{LED\_PREFIX}}” workaround doesn’t work either, I’m afraid.

---

<div class="post-metadata">

**Author:** ![U.Luke](https://avatars.discourse-cdn.com/v4/letter/u/65b543/32.png) [@U.Luke](https://librepcb.discourse.group/u/U.Luke)\
**Post date:** [June 19, 2025, 3:19pm UTC](https://librepcb.discourse.group/t/custom-component-attributes/938/4 "2025-06-19T15:19:25Z")

</div>

Oh okay, thanks for looking into it anyways!
