Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save luisvinicius09/a0fb99a5fd7d6ebaa67f0c959757838e to your computer and use it in GitHub Desktop.
Save luisvinicius09/a0fb99a5fd7d6ebaa67f0c959757838e to your computer and use it in GitHub Desktop.
stepper
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