Bouton Bootstrap 4 JS
Classes CSS des boutons
Pour un tutoriel sur les boutons, lisez notre tutoriel sur les boutons Bootstrap .
Les classes ci-dessous peuvent être utilisées pour styliser n'importe quel élément <a>, <button> ou <input> :
Class | Description | Example |
---|---|---|
.btn |
Adds basic styling to any button | |
.btn-block |
Makes a block-level button (spans the full width of the parent element) | |
.btn-danger |
Indicates a dangerous or potentially negative action | |
.btn-dark |
Dark grey button | |
.btn-default |
Indicates a default/standard button | |
.btn-info |
Contextual button for informational alert messages | |
.btn-lg |
Makes a large button | |
.btn-light |
Light grey button | |
.btn-link |
Makes a button look like a link (will still have button behavior) | |
.btn-outline-* |
Creates an outlined/bordered button. Use any of the contextual classes as * (btn-outline-primary, btn-outline-success, etc) | |
.btn-primary |
Provides extra visual weight and identifies the primary action in a set of buttons | |
.btn-sm |
Makes a small button | |
.btn-success |
Indicates a successful or positive action | |
.btn-secondary |
Indicates a "less" important action | |
.btn-toolbar |
Combine sets of button groups into button toolbars for more complex components | |
.btn-warning |
Indicates caution should be taken with this action | |
.active |
Makes the button appear pressed | |
.disabled |
Makes the button disabled |
Via Javascript
Activer manuellement avec :
$('.btn').button();
Options des boutons
None |
Méthodes de bouton
Le tableau suivant répertorie toutes les méthodes de bouton disponibles.
Remarque : Les méthodes peuvent également être transmises via des attributs de données ; ajoutez le nom de la méthode à data-, comme dans data-toggle ou data-dispose.
Method | Description | Try it |
---|---|---|
.button("toggle") | Makes the button look pressed | |
.button("dispose") | Destroys an element's button |