Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
An alert is a modal dialog that interrupts the user's workflow to communicate an important message and acquire a response.
import { Alert, Heading, Content, useAlertTriggerContext } from "@sharegate/orbit-ui";
aria-label
and aria-describedby
defaults to the alert <Heading>
and <Content>
values.aria-label
and aria-describedby
props on the alert.autoFocusButton
prop on the alert to specify which control should have the initial focus.autoFocusButton="secondary"
.An alert must have an heading, some content and a primary button label.
An alert can have a secondary button.
An alert can have a cancel button.
An alert primary and secondary buttons can be disabled.
Use a confirmation alert when a non destructive action is required from a user.
Use a destructive alert to confirm a permanent change, like deleting data.
Use a warning alert to inform of a significant change.
Use a negative alert to inform that something went wrong, like a server error.
The open
state can be handled in controlled mode.
import { Alert } from "@sharegate/orbit-ui";
"heading", "content"
Name | Description | Default | ||
---|---|---|---|---|
autoFocusButton | The button to focus by default when the alert open. "primary""secondary""cancel" | - | ||
cancelButtonLabel | The cancel button label. string | - | ||
onCancelButtonClick | Called when the cancel button is clicked. (event: MouseEvent<Element, MouseEvent>) => void
| - | ||
onClose | Called when a closing event happenened. (event: SyntheticEvent<Element, Event>) => void
| - | ||
onPrimaryButtonClick | Called when the primary button is clicked. (event: MouseEvent<Element, MouseEvent>) => void
| - | ||
onSecondaryButtonClick | Called when the secondary button is clicked. (event: MouseEvent<Element, MouseEvent>) => void
| - | ||
primaryButtonDisabled | Whether or not the primary button is disabled. falsetrue | - | ||
primaryButtonLabel* | The primary button label. string | - | ||
secondaryButtonDisabled | Whether or not the secondary button is disabled. falsetrue | - | ||
secondaryButtonLabel | The secondary button label. string | - | ||
variant | The style to use. "warning""negative""confirmation""destructive" | "confirmation" | ||
wrapperProps | Additional props to render on the wrapper element. Partial<OmitInternalProps<InnerBoxProps, never> & RefAttributes<any>> | - | ||
zIndex | The z-index of the dialog. number | 1 |
import { Heading } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
size | An heading can vary in size. "xs" | "sm" | "md" | "lg" | "xl" | "2xs" | ResponsiveValue<"xs" | "sm" | "md" | "lg" | "xl" | "2xs"> | - |
slot | Slot to render into. string | - |
import { Content } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
slot | Slot to render into. string | - |