Configuration object
Main title text. Can be either a static string or a function that receives data and value, returning a string
Description text below the title. Can be either a static string or a function that receives data and value, returning a string
Icon component to display. Can be either a static React node or a function that receives data and value, returning a React node
Custom color for the icon. Can be either a static string or a function that receives data and value, returning a string
List of status items to display. Can be either a static array or a function that receives data and value, returning an array
Text alignment for title ('left', 'center', or 'right'). Defaults to 'center'
Text alignment for description ('left', 'center', or 'right'). Defaults to 'center'
Additional CSS class name
Custom styling
Basic usage with static title and description
completion({
title: 'Task Completed Successfully',
description: 'All operations have been completed without errors.'
});
Usage with dynamic title depending on other fields
completion({
title: ({data}) => `Welcome back, ${data.userName}! Your task is complete.`,
description: 'Thank you for using our service.'
});
Usage with custom icon and status list
completion({
title: 'Data Processing Complete',
description: 'All files have been processed successfully.',
icon: <IconCircleCheckFilled size={80} strokeWidth={1} />,
statusList: [
{ value: 'success', label: 'Data validation completed' },
{ value: 'success', label: 'Files uploaded successfully' },
{ value: 'warning', label: 'Some optional fields were empty' }
]
});
Usage with dynamic icon depending on other fields
completion({
title: 'Task Complete',
description: 'Your task has finished.',
icon: ({data}) => {
if (data.taskType === 'success') return <IconCircleCheck size={80} strokeWidth={1} />;
if (data.taskType === 'warning') return <IconAlertTriangle size={80} strokeWidth={1} />;
return <IconCircleCheckFilled size={80} strokeWidth={1} />;
}
});
Usage with dynamic statusList depending on other fields
completion({
title: 'Operation Complete',
description: 'Results are ready.',
statusList: ({data}) => {
const items = [];
if (data.processedFiles > 0) {
items.push({ value: 'success', label: `${data.processedFiles} files processed` });
}
if (data.errors > 0) {
items.push({ value: 'error', label: `${data.errors} errors found` });
}
return items;
}
});
Completion component for displaying completion status with optional icon, title, description, and status list.