Skip to main content

Alert

Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.

Implementation#

import { Alert } from "slipstream-ui";
const Example = () => <Alert>I am a message</Alert>;

Colors#

Change component background color to any color provided by tailwind. Defaults to the "100" level shade.

Example
<Alert color="blue">Blue Message</Alert>

Sizing#

Example
<Alert size="md">Sizing - Medium</Alert>

Dark#

Convert lighter alert to a darker shade

Example
<Alert dark>Dark Message</Alert>

onClick#

Enabled a close icon that can be clicked on to initiate an action.

Example
<Alert onClick={() => {}}>Click the icon</Alert>

Props#

AttributeTypeValueDefault ValueDescription
colorstringe.g. blueblueDefine color resulting in bg-[color]-100.
Setting color to black or white will override shade and dark props.
shadestring100/200/etc...Override default background shade and dark shade
darkbooleantrue/falsefalseChanges postfix of color to bg-[color]-500
sizestringsm/md/lgsmSet padding and text sizing of component
onClickfunctionEnables a close icon with click functionality