0.1.1-7 • Published 11 months ago

sfida-alert-component v0.1.1-7

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

Intro

Componente Alert

Uso Base

Il componente ha due richieste obligatoire, il contenuto del componente e il tipo di Alert

import { AlertComponent } from "sfida-alert-component/esm";

<AlertComponent type="warning">
    This is a warning alert — check it out
</AlertComponent>

Il type può essere di 4 tipi

type: "warning" | "error" | "info" | "success";

withClose

Tra i parametri opzionali c'è la possibilità di rendere chiudibile l'alert

<AlertComponent withClose title="ciao" type="error">
    This is a error alert — check it out
</AlertComponent>

implementazione trmaite metodo

è possibile utilizzare, al posto del componente,il metodo getAlert() dell'ogetto useAlertServices, utilizzando gli stessi parametri utilizzati dal componente

getAlert({
    children: "Testo",
    type: "error",
    withClose: true,
})