Skip to main content

Alert

<sc-alert></sc-alert>

This component let users add alert message.

Click Me!

Component Codex

Properties

PropertyDescriptionTypeDefault
closableMakes the alert closable.booleanfalse
durationThe length of time, in milliseconds, the alert will show before closing itself. If the user interacts with the alert before it closes (e.g. moves the mouse over it), the timer will restart. Defaults to `Infinity`.numberInfinity
noIconNo iconboolean
openIndicates whether or not the alert is open. You can use this in lieu of the show/hide methods.booleanfalse
scrollMarginScroll marginstring'0px'
scrollOnOpenScroll into view.boolean
titleThe title.string
typeThe type of alert."danger" | "info" | "primary" | "success" | "warning"'primary'

Events

EventDescriptionType
scHideWhen alert is hiddenCustomEvent<void>
scShowWhen alert is shownCustomEvent<void>

Methods

hide() => Promise<void>

Hides the alert

show() => Promise<void>

Shows the alert.

Shadow Parts

PartDescription
baseThe elements base wrapper.
closeThe close icon.
iconThe alert icon.
messageThe alert message.
textThe alert text.
titleThe alert title.