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

88
Visualizações
How to add border radius on react-jdenticon component?

I have used react-jdenticon

Tried to add border radius but it seems that it can not take the css styling on svg or canvas element.

Any suggestions for this?

import React from 'react';
import Jdenticon from 'react-jdenticon';

function Example(){
  return(<Jdenticon size="48" value="Hello World" />);
}
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

If you want to customize the css styling on SVG images. I would suggest you to use the jdenticon package for this purpose. Using the jdenticon build a custom component with the following code. Now you can add the CSS classes or any styling to SVG element which you wants to add.

import React, { useRef, useEffect } from 'react';
import jdenticon from 'jdenticon';

const Jdenticon = ({ value = 'test', size = '100%', className }) => {
  const icon = useRef(null);
  useEffect(() => {
    jdenticon.update(icon.current, value);
  }, [value]);

  return (
    <div>
      <svg data-jdenticon-value={value} height={size} ref={icon} width={size} className={className} />
    </div>
  );
};

Now for the usage, you can use it in this way.

function Usage(){
  return(<Jdenticon size="48" value="Hello World", className="custom-name" />);
}
about 4 years ago · Juan Pablo Isaza Relatório

0

The above solution works for jdenticon package

but is there any solution for react-jdenticon maybe we can extend

<Jdenticon size="48" value="Hello World" 'pass classname here'/>
about 4 years ago · Juan Pablo Isaza Relatório
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