+ {!showText && index > 0 && (
+
= item.step ? 'bg-primary' : 'bg-base-4'
+ }`}
+ />
+ )}
+
+ item.handleClick?.()}
+ className={`font-bold ${
+ item.handleClick ? 'cursor-pointer' : ''
+ }`}
+ >
+ {item.step}
+
+
+ {showText && (
+
item.handleClick?.()}
+ className={`text-center my-auto text-sm ${showText ? '' : ''}
+ ${item.step < 2 ? 'cursor-pointer' : ''}
+ ${currentStep === item.step ? 'font-bold' : ''}`}
+ >
+ {item.text}
+
+ )}
+ {!showText && index < steps.length - 1 && (
+
item.step ? 'bg-primary' : 'bg-base-4'
+ }`}
+ />
+ )}
+
+ )
+ })}
+
+ )
+ }
+)
+
+type StepType = {
+ step: number
+ text?: string
+ handleClick?: Function
+ customClassName?: string
+}
+
+export interface StepperProps {
+ /**
+ * Custom class name
+ * */
+ className?: string
+ /**
+ * Current page step
+ * */
+ currentStep: number
+ /**
+ * Array of steps containing the step number (1, 2, 3, ..., n),
+ * text with step's title (optional) and a handler for the
+ * step's click (optional)
+ * */
+ steps: StepType[]
+ /**
+ * Shows step text instead of linking lines
+ * */
+ showText?: boolean
+ /**
+ * Function to handle step click
+ * */
+}