App
App provides application-level holders for message and notification APIs.
@duskmoon-dev/components/app Usage
When to use
- Use it immediately after user actions or system checks that need visible confirmation.
- Choose the least interruptive feedback surface that still makes the state clear.
Implementation notes
Features
Covers transient, inline, or blocking feedback patterns for user actions and system status.
Shows how the component keeps next actions visible after success, warning, or failure states.
App is most often configured through `component`, `message`, `maxCount`, `duration`.
Provides message and notification APIs through context
Feature Demos
Feature demos are authored for the component page, then supplemented with behavior scenarios from the component test coverage.
Basic usage
Import the component stylesheet and App from its package subpath, then render it with the core props.
import "@duskmoon-dev/components/styles.css";
import { App } from "@duskmoon-dev/components/app";
export function Example() {
return (<App>DuskMoon App</App>);
} Provides message and notification APIs through context
test-backedApp scenario from the component test coverage: provides message and notification apis through context.
import "@duskmoon-dev/components/styles.css";
import { App } from "@duskmoon-dev/components/app";
export function AppProvidesMessageAndNotificationDemo() {
return (<App>DuskMoon App</App>);
} Supports custom root component and className
test-backedApp scenario from the component test coverage: supports custom root component and classname.
import "@duskmoon-dev/components/styles.css";
import { App } from "@duskmoon-dev/components/app";
export function AppSupportsCustomRootComponentDemo() {
return (<App>DuskMoon App</App>);
} Supports fragment mode
test-backedApp scenario from the component test coverage: supports fragment mode.
import "@duskmoon-dev/components/styles.css";
import { App } from "@duskmoon-dev/components/app";
export function AppSupportsFragmentModeDemo() {
return (<App>DuskMoon App</App>);
} Theme aware
Docs previews inherit the DuskMoon data-theme value. Use the header switch to compare light and dark rendering.
<div data-theme="sunshine">
<App>DuskMoon App</App>
</div>
<div data-theme="moonlight">
<App>DuskMoon App</App>
</div> API
The API reference below lists every parsed exported type or interface for App. Start with `component`, `message`, `maxCount`, `duration` for common usage.
packages/components/src/components/app/App.types.ts
Scenarios: packages/components/src/components/app/App.test.tsx | Prop | Type | Required | Description |
|---|---|---|---|
children | ReactNode | No | children configures App. |
className | string | No | className configures App. |
component | false | ElementType | No | component configures App. |
message | { | No | message configures App. |
maxCount | number | No | maxCount configures App. |
duration | number | No | duration configures App. |
notification | { | No | notification configures App. |
maxCount | number | No | maxCount configures App. |
duration | number | null | No | duration configures App. |
| Prop | Type | Required | Description |
|---|---|---|---|
message | MessageApi | Yes | message configures App. |
notification | NotificationApi | Yes | notification configures App. |
modal | ModalComponent | Yes | modal configures App. |
| Prop | Type | Required | Description |
|---|---|---|---|
useApp | () => AppInstance | Yes | useApp configures App. |
Context | Context<AppContextValue> | Yes | Context configures App. |
AppInstance