Created
June 16, 2022 19:07
-
-
Save luisvinicius09/a0fb99a5fd7d6ebaa67f0c959757838e to your computer and use it in GitHub Desktop.
stepper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Box, Flex, Text } from "@chakra-ui/react"; | |
type StepProps = { | |
activeColor?: string; | |
defaultColor?: string; | |
title: string; | |
isFirst?: boolean; | |
index: number; | |
isActive?: boolean; | |
isLast?: boolean; | |
}; | |
const Step = ({ title, index }: StepProps) => { | |
return ( | |
<Box> | |
<Text>{title}</Text> | |
</Box> | |
); | |
}; | |
type StepperProps = { | |
activeStep: number; | |
steps: [{ title: string }]; | |
defaultColor?: string; | |
activeColor?: string; | |
}; | |
const Stepper = ({ | |
activeStep, | |
steps, | |
defaultColor = "", | |
activeColor = "", | |
}: StepperProps) => { | |
return ( | |
<Flex> | |
{steps.map((step, index) => ( | |
<Step key={index} title={step.title} index={index} /> | |
))} | |
</Flex> | |
); | |
}; | |
export const ProgressBar = () => { | |
return ( | |
<Box> | |
<Stepper steps={[{ title: "Informações" }, { title: "Informações" }, { title: "Informações" }]} activeStep={1} /> | |
</Box> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment