Configuration object for the badge component
A JSX element representing the badge component
Usage with custom icon and dynamic label
badge({
name: 'download-status',
label: (state) => state.downloadProgress + '%',
icon: 'download'
});
Usage with custom colors
badge({
name: 'priority',
label: 'High Priority',
icon: 'warning',
bgColor: '#ff4444',
color: '#ffffff'
});
Usage with dynamic colors based on state
badge({
name: 'status',
label: (state) => state.taskStatus,
bgColor: (state) => state.taskStatus === 'completed' ? '#22c55e' : '#f59e0b',
color: '#ffffff'
});
Usage with React node as label and default value
badge({
name: 'warning',
label: <span>Custom <strong>formatted</strong> label</span>,
icon: 'warning',
defaultValue: 'Initial Warning'
});
Creates a badge component for displaying a label with an optional icon.