Skip to content

[Feature] SYST-583: Add our own Toast component#411

Merged
adamnoto merged 31 commits into
mainfrom
feature/add-our-own-toast-component
Jun 3, 2026
Merged

[Feature] SYST-583: Add our own Toast component#411
adamnoto merged 31 commits into
mainfrom
feature/add-our-own-toast-component

Conversation

@alimnfl
Copy link
Copy Markdown
Contributor

@alimnfl alimnfl commented Jun 2, 2026

Description:
This pull request introduces a Toast component, allowing users to display notifications without relying on a third-party library. It provides a built-in, theme-aware solution with a simple and consistent API.

API

import { Toast } from "@systatum/coneto/toast";

Toast.alert({
  variant: "success",
  title: "Optional title",
  content: "Required content",
  actions: [],
  icon: {
    image: <CustomIcon />,
    position: "left-center",
  },
  closable: true,
  disappearAfterMs: 700,
  styles: {
    titleStyle: {},
    contentStyle: {},
    actionsStyle: {},
    containerStyle: {},
    iconStyle: {},
  },
  maxWidth: undefined,
  width: undefined,
  position: "top-right",
  detailSlot: <></>,
});

Behavior

  • Support variants: primary, success, warning, danger, and neutral.
  • Use appropriate default icons for supported variants.
  • If variant is neutral or unsupported, do not render a default icon.
  • If a custom icon is provided, it takes precedence over the variant icon.
  • Provide convenience methods:
    • Toast.primary()
    • Toast.success()
    • Toast.warning()
    • Toast.danger()
    • Toast.neutral()
  • Use fade-in and fade-out animations when showing and dismissing a toast.
  • When detailSlot is provided, render a Show more toggle that expands/collapses the content and updates the chevron accordingly.
  • Expanding the detail section disables automatic dismissal.
  • When closable is enabled:
    • Render a close button in the top-right corner.
    • Only show the close button on hover.

Icon Positions

Support:

  • left-center (default)
  • left-top
  • right-center
  • right-top
  • center-center

Stories

  • Default
  • With actions
  • With detail slot
  • Loading toast using a custom LoadingSpinner and center-center icon position
  • Positions

Source:
[Feature] SYST-583: Add our own Toast component

Tick what you have done:
[x] I have double checked the functionality with the ticket in linear, or any other relevant discussion avenue
[x] I have created/updated any relevant test code
[x] I have tested it myself

@alimnfl alimnfl self-assigned this Jun 2, 2026
@linear
Copy link
Copy Markdown

linear Bot commented Jun 2, 2026

SYST-583

@systatum systatum deleted a comment from github-actions Bot Jun 2, 2026
@systatum systatum deleted a comment from github-actions Bot Jun 3, 2026
@systatum systatum deleted a comment from github-actions Bot Jun 3, 2026
@systatum systatum deleted a comment from github-actions Bot Jun 3, 2026
@systatum systatum deleted a comment from github-actions Bot Jun 3, 2026
@systatum systatum deleted a comment from github-actions Bot Jun 3, 2026
@systatum systatum deleted a comment from github-actions Bot Jun 3, 2026
@alimnfl alimnfl requested a review from adamnoto June 3, 2026 06:17
@systatum systatum deleted a comment from github-actions Bot Jun 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Coneto Storybook preview deployed to: https://dev.files.systatum.com/coneto/ff152a2c

@systatum systatum deleted a comment from github-actions Bot Jun 3, 2026
@systatum systatum deleted a comment from github-actions Bot Jun 3, 2026
@systatum systatum deleted a comment from github-actions Bot Jun 3, 2026
@systatum systatum deleted a comment from github-actions Bot Jun 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Coneto Storybook preview deployed to: https://dev.files.systatum.com/coneto/ff152a2c

Copy link
Copy Markdown
Contributor

@adamnoto adamnoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a bit request

Comment thread components/toast.tsx Outdated
store.root.render(<ToastBridge position={_position} />);
}

const positionCss = (pos: ToastPosition) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't need to be a function right? we can just simply declare TOAST_POSITION_STYLE Record and call it immediately, so no need a function call

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread components/toast.tsx Outdated
let _uid = 0;
const timers = new Map<string, ReturnType<typeof setTimeout>>();

function scheduleRemove(id: string, position: ToastPosition, delay: number) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scheduleRemoval

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@alimnfl alimnfl requested a review from adamnoto June 3, 2026 10:38
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Coneto Storybook preview deployed to: https://dev.files.systatum.com/coneto/ff152a2c

Copy link
Copy Markdown
Contributor

@adamnoto adamnoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

@adamnoto adamnoto merged commit e97302b into main Jun 3, 2026
1 check passed
@adamnoto adamnoto deleted the feature/add-our-own-toast-component branch June 3, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants