Como coloco una svg en react

Iniciado por Angel Alvarez, Abril 10, 2024, 11:46:18 AM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Abril 10, 2024, 11:46:18 AM Ultima modificación: Abril 11, 2024, 02:53:03 PM por blackdrake
Necesito colocar un svg en react
Ngl

Hola,

No entiendo tu pregunta, en primer lugar te recomiendo que te leas este post sobre cómo realizar preguntas correctamente: You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Acto seguido, ¿Dónde quieres colocar el svg? Simplemente debes introducirlo como cualquier otro elemento, como harías en HTML, ejemplo:

Código: react
import "./App.css";
function App() {
  return (
    <div className="App">
      <svg
        xmlns="http://www.w3.org/2000/svg"
        width="48"
        height="48"
        fill="currentColor"
        class="bi bi-google"
        viewBox="0 0 16 16"
      >
        <path d="M15.545 6.558a9.42 9.42 0 0 1 .139 1.626c0 2.434-.87 4.492-2.384 5.885h.002C11.978 15.292 10.158 16 8 16A8 8 0 1 1 8 0a7.689 7.689 0 0 1 5.352 2.082l-2.284 2.284A4.347 4.347 0 0 0 8 3.166c-2.087 0-3.86 1.408-4.492 3.304a4.792 4.792 0 0 0 0 3.063h.003c.635 1.893 2.405 3.301 4.492 3.301 1.078 0 2.004-.276 2.722-.764h-.003a3.702 3.702 0 0 0 1.599-2.431H8v-3.08h7.545z" />
      </svg>
    </div>
  );
}
export default App;