@payfit/unity-components
Version:
42 lines (41 loc) • 1.03 kB
TypeScript
import { FC } from 'react';
export interface FunnelBackButtonProps {
/**
* Label for the back button.
* Shown as text on desktop, used as aria-label on mobile.
*/
label: string;
/**
* Callback when back button is pressed.
*/
onPress: () => void;
/**
* Maximum length of the label to truncate.
* Defaults to 10 characters.
*/
truncateLabelLength?: number;
}
/**
* Back button component for use in FunnelTopBar leading slot.
* Automatically adapts between desktop (text + icon) and mobile (icon only) layouts.
* @example
* ```tsx
* import { FunnelTopBar, FunnelBackButton } from '@payfit/unity-components'
*
* function MyFunnel() {
* return (
* <FunnelTopBar
* leading={
* <FunnelBackButton
* label="Back to dashboard"
* onPress={handleBack}
* />
* }
* title="Step 2"
* progressValue={50}
* />
* )
* }
* ```
*/
export declare const FunnelBackButton: FC<FunnelBackButtonProps>;