# Inline notice

A calm confirmation that stays in context until someone dismisses it.

## Usage

Render after a successful action. Keep important feedback available until the user dismisses it; do not hide it on a short timer.

Save the JSX and CSS Module in the same folder in a React project with CSS Modules support. Controlled components need parent state and change handlers.

## JSX

```jsx
"use client";
import styles from "./InlineNotice.module.css";
export default function InlineNotice({
  title = "Changes saved",
  children = "Your team can see the latest version.",
  onDismiss,
}) {
  return (
    <div className={styles.notice}>
      <div role="status">
        <strong>{title}</strong>
        <p>{children}</p>
      </div>
      {onDismiss && (
        <button
          type="button"
          onClick={onDismiss}
          aria-label="Dismiss notification"
        >
          ×
        </button>
      )}
    </div>
  );
}

```

## CSS

```css
.notice {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--tdp-border, #d9d1c9);
  border-left: 3px solid var(--tdp-primary, #1f3934);
  background: var(--tdp-surface, #fffdfa);
  border-radius: var(--tdp-radius, 8px);
  color: var(--tdp-text, #302e2b);
  font: 14px/1.5 var(--tdp-font, "DM Sans", system-ui, sans-serif);
  box-shadow: none;
}
.notice strong {
  font-size: 15px;
}
.notice p {
  margin: 6px 0 0;
}
.notice button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  margin: -9px -9px 0 0;
  border: 0;
  border-radius: var(--tdp-radius, 8px);
  background: transparent;
  color: inherit;
  font: 24px var(--tdp-font, "DM Sans", system-ui, sans-serif);
  cursor: pointer;
}
.notice button:hover {
  background: #f0f0f0;
}
.notice:focus-visible,
.notice :where(button, input, summary):focus-visible {
  outline: 3px solid var(--tdp-focus, #7851a9);
  outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .notice,
  .notice :where(button, input, summary, span) {
    transition: none !important;
    animation: none !important;
  }
}

```

## Props

- title (string): Short confirmation heading.
- children (ReactNode): Supporting information.
- onDismiss (function): When supplied, shows a dismiss button.

## Accessibility

The message uses a polite status region. The optional dismiss control has an explicit accessible name and a 44px target. For urgent errors, use a separate alert pattern.

Check accessibility again after customizing the component.

[Browse all components](/resources/components/)

Canonical: https://designproject.io/resources/components/inline-notice/

## Keep learning

- [How to create a UI color palette, step by step](https://designproject.io/resources/guides/create-ui-color-palette/)
- [Product design glossary: 44 terms explained](https://designproject.io/resources/glossary/)
- [How to choose font pairings for a product interface](https://designproject.io/resources/guides/choose-font-pairings/)
