@app-studio/components
Message
Display application messages with showMessage and a mounted MessageLayout. MessageView supplies the presentation props below.
View component sourceImport
ts
import { MessageLayout, showMessage } from '@app-studio/components';New to the library? Complete installation and provider setup first.
Interactive examples
Try the component, then open Code to copy the complete example.
import React from 'react';
import { MessageLayout, showMessage } from '@app-studio/components';
import { Button } from '@app-studio/components';
export function MessageExample() {
return (
<>
<Button
onClick={() =>
showMessage(
'success',
'Changes saved',
'Your local example is ready.',
{ isClosable: true }
)
}
>
Show message
</Button>
<MessageLayout />
</>
);
}Props
Required props are marked below. A dash indicates an unspecified default. Design system configuration can override implementation defaults.
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
subtitle | string | — | See the type and source declaration for this property.Source |
variant Required | "error" | "info" | "success" | "warning""error""info""success""warning" | — | Visual treatment of the component.Source |
show | boolean | — | See the type and source declaration for this property.Source |
hide Required | () => void | — | See the type and source declaration for this property.Source |
title Required | string | — | Main title displayed by the component.Source |
theme | ThemesType | — | See the type and source declaration for this property.Source |
isClosable | boolean | false | See the type and source declaration for this property.Source |
views | MessageViewStyles | — | Style overrides for the named internal parts.Source |
action | (() => void) | — | See the type and source declaration for this property.Source |
actionText | string | — | See the type and source declaration for this property.Source |
showIcon | boolean | false | See the type and source declaration for this property.Source |
timeout | number | 3000 | See the type and source declaration for this property.Source |
For shared layout, color, and responsive properties, read Styling & composition and Responsive layouts. Additional native element attributes depend on the target platform.
Usage guidance
- Give controls a visible label or an accessible name, and verify keyboard interaction. See Accessibility.
- For controlled inputs, update the value from the callback shown in the props table. Keep application state in your component or form library.
- These previews run in the browser. Check React Native setup for platform requirements and differences.