Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

224
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda