Button component
Botón con dos variantes: primary y ghost. Renderiza <a> si tiene
href, o <button> si no.
IMPORTAR
import { Button } from 'jp-astro-components'; Variantes
<Button href="#">Acción principal →</Button> <Button href="#" variant="ghost">Acción secundaria</Button> <Button href="/navbar">Ir a Navbar →</Button>
<Button href="https://astro.build" variant="ghost" external>astro.build ↗</Button> <Button id="demo-btn">Haz click</Button>
<script>
document.getElementById('demo-btn').addEventListener('click', () => {
// tu lógica aquí
});
</script> Props
| Prop | Tipo | Default |
|---|---|---|
| variant | 'primary' | 'ghost' | 'primary' |
| href | string | — (renderiza <button>) |
| external | boolean | false |
| ...rest | HTMLButtonAttributes | HTMLAnchorAttributes | — |