Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

216
Views
How to create colored square shapes next to the text using JS character codes

I have a dijit Listbox with several items inside. Currently, the items inside the list box can only be plain text. The widget doesn't allow me to add icons or CSS properties. As a workaround, I am using Javascript codes to create colored square shapes next to the text of each item.

 const items = [{
                    label: '\uD83D\uDFE5 ' + 'Overflow',
                }, {
                    label: '\uD83D\uDFE8 ' + 'Underflow',
                }, {
                    label: '\uD83D\uDFE6 ' + 'Precision,
                }];

I got the standard JS codes above from the internet. But, for consistency with other indicators in our app, I want slightly different versions of these colors above, and I am unsure how to get the JS code for them.

How would I translate the following colors into a colored square shape using JS character codes? And is there a better alternative to add these colored shapes next to the text?

red - rgb(226, 61, 45)
blue - rgb(135,206,235)
Yellow - rgb(241, 181, 28)

Thanks

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!