Skip to main content

Command Palette

Search for a command to run...

New Button Badges in Oracle APEX 26.1.

Learn how to add badges to Oracle APEX 26.1 buttons using the new data-count attribute, with examples and theme insights.

Updated
2 min read
New Button Badges in Oracle APEX 26.1.
T

Oracle APEX developer at Pretius

One of the new features in APEX 26.1. is Badge support for buttons using data-count attribute.

It is very simple to use, and has many potential use cases, let's see how it works.

In the button attributes, in Advanced settings, there is a field Custom Attributes. It is now possible to define the data-count attribute here to add Badge inside of the button.

The data-count attribute can also be filled with variables like page items, etc. In this example I used this value for the Test button data-count="&P10_TEST1.".

This will take the value from page item P10_TEST1 and show it as a Badge inside of the button.

From what I saw while testing this new attribute, it looks like the color palette of the badges is dependent on the Primary color of the Theme I used. It can automatically create two types of color combination, for dark and light backgrounds.

For the Redwood Dark theme, the color of the badge is identical as the Primary color on a button. So the Badge disappears when applied on Primary Button, which may be problematic.

But for the new Iris theme in APEX 26.1. the badge will take the Primary color from the theme and will still be visible on a Primary button.

Below are few examples of the color combinations for the Iris theme.

Is this new functionality replacing badges in APEX? Is it something that we will use in all the applications? No, but it can be a very fast fix if you need a simple badge in your button.

For more advanced use cases, when you need a dynamic refresh, or you need to place the badge on a different component, I will still recommend the Pretius-apex-badge-plugin.

Thank you for reading the article and see you next time.