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
Name | Type |
---|---|
props | AlertProps & RefAttributes <HTMLDivElement (opens in a new tab)> |
Returns
null
| ReactElement
<any
, string
| JSXElementConstructor
<any
>>
Example
<Alert onDismiss={() => {}}>
<Text>Message</Text>
<Action>Action</Action>
</Alert>
import React from 'react' import { Alert } from '@vtex/shoreline-components' import { Text } from '@vtex/shoreline-components' import { 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