WS
Docs /Atomes/Button

Button

Bouton interactif polyvalent. Supporte variants, couleurs, tailles, icônes, état de chargement et liens.

Blade
Aperçu
Blade
<x-ws::button variant="solid" color="primary">Solid</x-ws::button>
<x-ws::button variant="outline" color="primary">Outline</x-ws::button>
<x-ws::button variant="ghost" color="primary">Ghost</x-ws::button>
<x-ws::button variant="soft" color="primary">Soft</x-ws::button>
<x-ws::button variant="link" color="primary">Link</x-ws::button>

Props

Prop Type Défaut Description
variant string solid solid | outline | ghost | soft | link
color string primary primary | secondary | success | danger | warning | info | neutral
size string md xs | sm | md | lg | xl
rounded string md none | sm | md | lg | full
loading bool false Affiche un spinner et désactive le bouton
disabled bool false Désactive le bouton
full bool false Largeur 100%
square bool false Taille égale (carré, pour icônes seules)
icon string Nom d'icône Heroicons (avant le texte)
iconTrailing string Nom d'icône Heroicons (après le texte)
href string null Si défini, rend une balise &lt;a&gt;
buttonType string button button | submit | reset
confirm string null Affiche une confirmation avant l'action

Couleurs

<x-ws::button color="primary">Primary</x-ws::button>
<x-ws::button color="secondary">Secondary</x-ws::button>
<x-ws::button color="success">Success</x-ws::button>
<x-ws::button color="danger">Danger</x-ws::button>
<x-ws::button color="warning">Warning</x-ws::button>
<x-ws::button color="info">Info</x-ws::button>
<x-ws::button color="neutral">Neutral</x-ws::button>

Tailles

<x-ws::button size="xs">XS</x-ws::button>
<x-ws::button size="sm">SM</x-ws::button>
<x-ws::button size="md">MD</x-ws::button>
<x-ws::button size="lg">LG</x-ws::button>
<x-ws::button size="xl">XL</x-ws::button>

Avec icônes

<!-- Icône avant -->
<x-ws::button icon="plus">Ajouter</x-ws::button>

<!-- Icône après -->
<x-ws::button icon-trailing="trash">Supprimer</x-ws::button>

<!-- Bouton carré (icône seule) -->
<x-ws::button :square="true" icon="pencil" />

États

<!-- Loading -->
<x-ws::button :loading="true">Enregistrement…</x-ws::button>

<!-- Disabled -->
<x-ws::button :disabled="true">Non disponible</x-ws::button>

<!-- Full width -->
<x-ws::button :full="true">Pleine largeur</x-ws::button>

Bouton-lien

Passez href pour rendre une balise <a> avec le style d'un bouton.

<x-ws::button href="https://www.wirestack.liptra.net/docs/badge" icon-trailing="arrow-right">
    Voir Badge
</x-ws::button>

Confirmation

La prop confirm affiche une boîte de dialogue native avant de soumettre.

<x-ws::button
    color="danger"
    variant="solid"
    confirm="Êtes-vous sûr de vouloir supprimer cet élément ?"
    wire:click="delete">
    Supprimer
</x-ws::button>