Components
Alert
Code

Alert

Alert(props): null | ReactElement<any, string | JSXElementConstructor<any>>

Alert indicators allow users to view semantic messages that are prominent and can be dismissable.

Parameters

NameType
propsAlertProps & RefAttributes<HTMLDivElement (opens in a new tab)>

Returns

null | ReactElement<any, string | JSXElementConstructor<any>>

Example

example.tsx
<Alert onDismiss={() => {}}>
  <Text>Message</Text>
  <Action>Action</Action>
</Alert>
import React from 'react'
import { Alert, Text, Action } from '@vtex/shoreline-components'

export default function App() {
return (<>
<Alert onDismiss={() => {}}>
<Text>Message</Text>
<Action>Action</Action>
</Alert>
</>
)}

Defined in

node_modules/.pnpm/@types+react@18.2.14/node_modules/@types/react/ts5.0/index.d.ts:355