Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

92
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda