Code
Props
children
strin-HTML tags -Custom Components (MenuOption, MenuHeader and MenuDivider)
className
string
title
string
type
string
(Info, Warning, Danger)
show
boolean
commland
boolean
commland prop is used to adjust the Alert component to the Commland UI-Shell automatically.
Where to Insert This Component in Comm.land?
This component should overlay all the content inside the application. To keep a better order and avoiding problems with UI Shell, it is recommended inserting this component outside and next to the AppPage component. If it is inserted inside the AppPageContent component, the modal is not going to render correctly.
For a general usage, outside Comm.land and the UI Shell, the Alert component is recommended to be inserted either at the beginning or at the end of the react component where it is going to be used.
Children
To generate the structure required for the component, the developer can insert the following components as children elements:
AlertBody
In here, developer can insert all the HTML tags and Components needed.
children
-HTML tags -Custom Components (MenuOption, MenuHeader and MenuDivider)
AlertFooter
This section is designed specifically to be used with the Button Component in the default size.
children
SDS Buttons Component
The show and hide feature of the Alert Component is not included in this component by default. To execute this action, developers need to attach the function to the buttons inside the modal footer.
Because of design and functionality reasons, the only way to close an Alert Component is by using the buttons in the AlertFooter. It is not possible to exit by clicking in the overlay background or pressing the Esc key like in the Modal component.
Example
Components Dependency
For this component elaboration, the following internal components were used:
AlertBody
AlertFooter
Live Demo
For detailed code usage documentation, see the Storybooks for each framework below.
React
Last updated