Output will appear here...
Informazioni sulla conversione HTML a JSX
JSX è l'estensione di sintassi di React che assomiglia all'HTML ma con differenze importanti. Questo strumento automatizza tutte le trasformazioni necessarie: class in className, for in htmlFor, stringhe style inline in oggetti JavaScript.
Key Features
- Convert class attributes to className
- Convert for attributes to htmlFor for labels
- Transform style strings to style objects
- Handle event handlers (onclick → onClick)
- Support data-* attributes (pass-through)
- 100% client-side — your code stays private
Domande frequenti
Cosa cambia la conversione HTML a JSX?
Cambiamenti principali: class → className, for → htmlFor, stili inline → oggetti style, tag auto-chiudenti con />, commenti HTML → {/* */}.
Perché non si può usare class in JSX?
In JSX, 'class' è una parola riservata JavaScript. React usa 'className' al suo posto.
Come vengono convertiti gli stili inline?
style="color: red; font-size: 16px" diventa style={{color: "red", fontSize: "16px"}}.
Gestisce i tag auto-chiudenti?
Sì. Elementi vuoti HTML come <br>, <hr>, <img> vengono convertiti in <br />, <hr />.
Valuta questo strumento
4.5 / 5 · 202 valutazioni
Resta aggiornato
Ricevi consigli dev e nuovi strumenti ogni settimana.
Niente spam. Cancella quando vuoi.
Enjoy these free tools?
☕Buy Me a CoffeeCome usare
- Incolla il markup HTML nel pannello di input
- Clicca Converti per trasformare in JSX
- Verifica l'output JSX convertito
- Copia e incolla nel tuo componente React
Casi d'uso comuni
- Migrare template HTML statici in componenti React
- Convertire HTML da tool di design (Figma, Webflow) in JSX
- Portare template email HTML in React Email
- Imparare le differenze tra sintassi HTML e JSX