Skip to main content

Flow

#Flow step component

Effect demonstration

1. Basic usage

  const steps = [
{ title: 'First Step', description: 'Test' },
{ title: 'Step 2', description: 'Test' },
{ title: 'Step 3', description: 'Test' },
{ title: 'Step 4', description: 'Test' },
];

<Text>Basic usage:</Text>
<Flow steps={steps} />
Basic use of ios

2. Specify progress

  const steps = [
{ title: 'First Step', description: 'Test' },
{ title: 'Step 2', description: 'Test' },
{ title: 'Step 3', description: 'Test' },
{ title: 'Step 4', description: 'Test' },
];


<Text>Specify progress:</Text>
<Flow steps={steps} current={3} />
Specify progress ios

3. Current status

    const steps = [
{ title: 'First Step', description: 'Test' },
{ title: 'Step 2', description: 'Test' },
{ title: 'Step 3', description: 'Test' },
{ title: 'Step 4', description: 'Test' },
];

<Text>Current status:</Text>
<Flow steps={steps} current={3} status="error" />
Current status ios

4. Custom icon

  const steps = [
{ title: 'First Step', description: 'Test', icon: <SvgIcon name="bells" /> },
{ title: 'Step 2', description: 'Test' },
{ title: 'Step 3', description: 'Test' },
{ title: 'Step 4', description: 'Test' },
];
<Text>Custom icon:</Text>
<Flow steps={steps} current={2} />
custom icon ios

5. Custom render

  const steps = [
{ title: 'First Step', description: 'Test', stepRender: <Text>111111111111</Text> },
{
title: 'Step 2',
description: 'Test',
stepRender: (
<Image style={{ height: 50, width: 50, borderRadius: 25 }} source={require('../../assets/images/img-01.jpg')} />
),
},
{ title: 'Step 3', description: 'Test', label: '1' },
{ title: 'Step 4', description: 'Test' },
];

<Text>Custom render:</Text>
<Flow steps={steps} current={2} size={50} />
custom render ios

6. Customize line style

 const steps4 = [
{
title: 'First Step',
description: 'Test',
activeColor: 'green',
},
{
title: 'Step 2',
description: 'Test',
},
{ title: 'Step 3', description: 'Test' },
{ title: 'Step 4', description: 'Test' },
];
<Text>Customized line style:</Text>
<Flow steps={steps4} current={2} />
Customize line style ios

API

Component properties

PropertiesRequiredDescriptionTypeDefault Value
statusfalseCurrent statuswait | process | finish | errorprocess
stepsfalsestep dataArray<StepProps>[]
sizefalseThe size of the icon of the step barnumberpx(36)
currentfalseCurrent progressnumber0

StepProps Properties

PropertiesRequiredDescriptionTypeDefault Value
titlefalseThe title of the stepstring
descriptionfalseIntroduction to stepsstring
labelfalseThe label of the step barstring
sizefalseNode sizenumberpx(36)
iconSizefalseicon sizenumberpx(16)
statusfalseThe status of the iconwait | process | finish | errorwait
iconfalseThe customized icon size will be overwritten. It is recommended to use size to specify the sizeReactElement
stepRenderfalseCustom componentReactElement
activefalseWhether the current node is fully processedbooleanfalse
isCurrentfalseWhether it is the current progressbooleanfalse
isLastfalseWhether it is the last onebooleanfalse