一键导入
groww-toast
Toast notification component for temporary feedback messages. Use for success confirmations, error alerts, warnings, and informational notices.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Toast notification component for temporary feedback messages. Use for success confirmations, error alerts, warnings, and informational notices.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Accordion component with collapsible sections. Use for FAQs, nested content, or expandable details sections.
Button component with variants, sizes, loading states, and icon support. Use when creating clickable actions, forms, or navigation buttons.
Calendar component for date and month selection. Use when building date pickers, scheduling interfaces, or date range selectors.
Carousel component for image/content sliders with navigation controls. Use for image galleries, hero sections, or content that scrolls horizontally.
Checkbox component for boolean or multi-select inputs. Use when building forms with boolean toggles or multiple selection lists.
Dropdown menu component with trigger and content pattern. Use when building selectable menus, action menus, or nested navigation.
| name | groww-toast |
| description | Toast notification component for temporary feedback messages. Use for success confirmations, error alerts, warnings, and informational notices. |
import Toast, { ToastProps } from '@groww-tech/ui-toolkit/dist/esm/components/atoms/Toast';
import Toaster, { ToasterProps } from '@groww-tech/ui-toolkit/dist/esm/components/atoms/Toaster';
import Toastify from '@groww-tech/ui-toolkit/dist/esm/components/atoms/Toastify';
// or
import { Toast, Toaster, Toastify } from '@groww-tech/ui-toolkit';
'success' - Green, for successful operations'error' - Red, for errors and failures'warning' - Orange, for warnings'info' - Blue, for informational messages'default' - Default gray styleinterface ToasterProps {
closeToast?: () => void;
toastId?: string | number;
autoClose?: number | false; // Auto close delay (ms)
closeOnClick?: boolean; // Close on click
type?: 'success' | 'error' | 'warning' | 'info' | 'default';
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
}
interface ToastProps {
type: 'success' | 'error' | 'warning' | 'info' | 'default';
message: string; // Toast message
isVisible?: boolean; // Visibility state
onClose?: () => void; // Close handler
duration?: number; // Display duration
action?: {
label: string;
onClick: () => void;
};
}
Toastify uses a different API - it provides a functional interface:
import Toastify from '@groww-tech/ui-toolkit/dist/esm/components/atoms/Toastify';
// Show toast
Toastify.show({
message: 'Operation successful!',
type: 'success',
duration: 3000,
});
// Methods
Toastify.success(message, duration?);
Toastify.error(message, duration?);
Toastify.warning(message, duration?);
Toastify.info(message, duration?);
Toastify.default(message, duration?);
Toastify.hide(); // Hide current toast
<Toast
type="success"
message="Settings saved successfully"
isVisible={showToast}
onClose={() => setShowToast(false)}
duration={3000}
/>
<Toaster
type="error"
message="Failed to save changes"
closeToast={() => setShowToast(false)}
autoClose={5000}
/>
// Success toast
Toastify.success('Profile updated!');
// Error toast
Toastify.error('Something went wrong. Please try again.');
// Warning toast
Toastify.warning('Your session will expire soon.');
// With action
Toastify.show({
message: 'New message received',
type: 'info',
action: {
label: 'View',
onClick: () => navigateToMessages(),
},
});