Documentation Index
Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
Use this file to discover all available pages before exploring further.
Alert
v1.0.0 | View in Storybook Alerts are considered medium-emphasis communication and should be used sparingly. Medium-priority feedback is informative and occasionally actionable. These messages are more noticeable but not urgent. They should draw attention without causing disruption.When to use
- For contextual guidance or inline recommendations: When users need clarification or additional context about their current task or when suggesting next steps within the workflow. Example: Displaying an Alert within a symbols or mapping list to help explain how a user can link or unlink assets.
- To communicate warnings or issues: When an action requires attention, but isn’t blocking progress or the user can resolve the issue in a separate context. Example: To alert the user that transformations have failed and user action is required to troubleshoot the problem.
- When actions need to be taken: If the user should resolve an issue directly within the Alert. Example: Re-establishing a failed connection.
Dos and don’ts
- Do use action Buttons when the action is specific to the message and will resolve (dismiss) it.
- Do consider other methods for feedback before using an Alert, such as inline validation on forms. Avoid mixing multiple feedback states as this becomes confusing or frustrating to a user.
- Don’t use action Buttons for unrelated activities or activities that don’t resolve the Alert.
Placement
- Always align the edge of the Alert relative to the surrounding content. Alerts should never be flush to a container’s divider.
- Use the card style Alert when content needs to wrap and applies to a small container.
- Use the strip style Alert when content is short and applies to a larger container.
Behavior
- Inline to the page: it does not block the full viewport like a Dialog or Alert dialog.
- Dismissal removes the alert from the layout (or hides it) per variant; optional actions should complete or dismiss the alert in one clear step.
- If the alert includes focusable controls, manage focus appropriately; otherwise it typically does not trap focus.
- Product rules decide whether dismissed state persists across navigation or sessions.