diff --git a/site/content/docs/react/components/stepper/a-ss.html b/site/content/docs/react/components/stepper/a-ss.html new file mode 100644 index 0000000..083d6d1 --- /dev/null +++ b/site/content/docs/react/components/stepper/a-ss.html @@ -0,0 +1,12 @@ +--- +--- + +
+ Name + | ++ Type + | ++ Default + | +Description | +
---|---|---|---|
+ activeStep
+ |
+ + Number + | +
+ -
+ |
+
+ Controls the active step.
+ In most cases the value should be managed with onChange handler.
+ |
+
+ customValidation
+ |
+ + (validableElement: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement) => boolean; + | +
+ -
+ |
+ + Sets custom validation for each validable element in linear stepper. + | +
+ defaultStep
+ |
+ + Number + | +
+ -
+ |
+ + Sets default step. Does not change the active step. + | +
+ linear
+ |
+ + bolean + | +
+ false
+ |
+ + Linear stepper prevents going back to the previous step after it was completed. + | +
+ theme
+ |
+ + object + | +
+ {}
+ |
+ + Allows to change the Tailwind classes used in the component. + | +
+ type
+ |
+ + 'vertical' | 'horizontal' + | +
+ 'horizontal'
+ |
+ + Sets stepper view mode. + | +
+ Name + | ++ Type + | ++ Default + | +Description | +
---|---|---|---|
+ theme
+ |
+ + object + | +
+ {}
+ |
+ + Allows to change the Tailwind classes used in the component. + | +
+ headIcon
+ |
+ + ReactNode + | +
+ ''
+ |
+ + Sets the icon in the step head. + | +
+ headText
+ |
+ + ReactNode + | +
+ ''
+ |
+ + Sets the text in the step head. + | +
Custom classes can be passed via theme
prop. Create an object with classes like below and pass it to the prop.
+ Name + | ++ Default + | +Description | +
---|---|---|
+ stepperHorizontal
+ |
+ + relative m-0 flex list-none justify-between overflow-hidden p-0 transition-[height] duration-200 ease-in-out + | +
+ Sets styles to the TEStepper element in horizontal mode.
+ |
+
+ stepperVertical
+ |
+ + relative m-0 w-full list-none overflow-hidden p-0 transition-[height] duration-200 ease-in-out + | +
+ Sets styles to the TEStepper element in vertical mode.
+ |
+
+ Name + | ++ Default + | +Description | +
---|---|---|
+ stepperStep
+ |
+ + w-[4.5rem] flex-auto + | +
+ Sets styles to the stepperStep element.
+ |
+
+ stepperStepVertical
+ |
+ + relative h-fit after:absolute after:left-[2.45rem] after:top-[3.6rem] after:mt-px after:h-[calc(100%-2.45rem)] after:w-px after:bg-[#e0e0e0] dark:after:bg-neutral-600 + | +
+ Sets styles to the stepperStep element in vertical mode.
+ |
+
+ stepperLastStepVertical
+ |
+ + relative h-fit + | +
+ Sets styles to the last stepperStep element in vertical mode.
+ |
+
+ disabledStep
+ |
+ + pointer-events-none + | +
+ Sets styles to disabled step in noEditable mode.
+ |
+
+ stepperHeadHorizontal
+ |
+ + flex cursor-pointer items-center leading-[1.3rem] no-underline before:mr-2 before:h-px before:w-full before:flex-1 before:bg-[#e0e0e0] before:content-[''] after:ml-2 after:h-px after:w-full after:flex-1 after:bg-[#e0e0e0] after:content-[''] hover:bg-[#f9f9f9] focus:outline-none dark:before:bg-neutral-600 dark:after:bg-neutral-600 dark:hover:bg-[#3b3b3b] + | +
+ Sets styles to the stepperHead element in horizontal mode.
+ |
+
+ stepperFirstStepHeadHorizontal
+ |
+ + flex cursor-pointer items-center pl-2 leading-[1.3rem] no-underline after:ml-2 after:h-px after:w-full after:flex-1 after:bg-[#e0e0e0] after:content-[''] hover:bg-[#f9f9f9] focus:outline-none dark:after:bg-neutral-600 dark:hover:bg-[#3b3b3b] + | +
+ Sets styles to the stepperHead element in horizontal mode for the first step.
+ |
+
+ stepperLastStepHeadHorizontal
+ |
+ + flex cursor-pointer items-center pr-2 leading-[1.3rem] no-underline before:mr-2 before:h-px before:w-full before:flex-1 before:bg-[#e0e0e0] before:content-[''] hover:bg-[#f9f9f9] focus:outline-none dark:before:bg-neutral-600 dark:after:bg-neutral-600 dark:hover:bg-[#3b3b3b] + | +
+ Sets styles to the stepperHead element in horizontal mode for the last step.
+ |
+
+ stepperHeadVertical
+ |
+ + flex cursor-pointer items-center p-6 leading-[1.3rem] no-underline hover:bg-[#f9f9f9] focus:outline-none dark:hover:bg-[#3b3b3b] + | +
+ Sets styles to the stepperHead element in vertical mode.
+ |
+
+ stepperHeadIconHorizontal
+ |
+ + my-6 mr-2 flex h-[1.938rem] w-[1.938rem] items-center justify-center rounded-full bg-[#6d6d6d] text-sm font-medium text-[#fff] dark:bg-[#757575] + | +
+ Sets styles to the stepperHeadIcon element in horizontal mode.
+ |
+
+ stepperHeadIconVertical
+ |
+ + mr-3 flex h-[1.938rem] w-[1.938rem] items-center justify-center rounded-full bg-[#6d6d6d] text-sm font-medium text-[#fff] dark:bg-[#757575] + | +
+ Sets styles to the stepperHeadIcon element in vertical mode.
+ |
+
+ stepperHeadIconCompletedBg
+ |
+ + !bg-success-100 !text-success-700 dark:!bg-[#04201f] dark:!text-[#72c894] + | +
+ Sets background color applied to the stepperHeadIcon element when step is completed.
+ |
+
+ stepperHeadIconActiveBg
+ |
+ + !bg-primary-100 !text-primary-700 dark:!bg-[#0c1728] dark:!text-[#628dd5] + | +
+ Sets background color applied to the stepperHeadIcon element when the step is active.
+ |
+
+ stepperHeadIconInvalidBg
+ |
+ + !bg-danger-100 !text-danger-700 dark:!bg-[#2c0f14] dark:!text-[#e37083] + | +
+ Sets background color applied to the stepperHeadIcon element when the step is invalid.
+ |
+
+ stepperHeadIconDisabledBg
+ |
+ + !bg-[#6d6d6d] !text-neutral-300 dark:!bg-[#757575] + | +
+ Sets background color applied to the stepperHeadIcon element when the step is disabled.
+ |
+
+ stepperHeadText
+ |
+ + text-neutral-500 after:flex after:text-[0.8rem] dark:text-neutral-300 + | +
+ Sets styles to the stepperHeadText element.
+ |
+
+ stepperHeadTextActive
+ |
+ + font-medium after:flex after:text-[0.8rem] after:content-[data-content] + | +
+ Sets styles to the stepperHeadText element when step is active.
+ |
+
+ stepperContentWrapper
+ |
+ + transition-all duration-500 ease-in-out overflow-hidden + | +
+ Sets styles to the stepperContent wrapper element.
+ |
+
+ stepperContent
+ |
+ + absolute left-0 w-full p-4 transition-all duration-500 ease-in-out translate-0 + | +
+ Sets styles to the stepperContent element.
+ |
+
+ stepperVerticalContent
+ |
+ + transition-[height,_margin-bottom,_padding-top,_padding-bottom] left-0 overflow-hidden pl-[3.75rem] pr-6 duration-300 ease-in-out + | +
+ Sets styles to the stepperContent element in vertical mode.
+ |
+
+ stepperContentTranslateLeft
+ |
+ + -translate-x-[150%] + | +
+ Additional animation style to the stepperContent element when step is active and it is on the left side of the screen.
+ |
+
+ stepperContentTranslateRight
+ |
+ + translate-x-[150%] + | +
+ Additional animation style to the stepperContent element when step is active and it is on the right side of the screen.
+ |
+
+ Name + | ++ Type + | ++ Default + | +Description | +
---|---|---|---|
+ onChange
+ |
+ + (prevStepId: number, targetStepId: number) => void; + | +
+ -
+ |
+ + Event fires when the stepper demands to change step. + | +
+ onInvalid
+ |
+ + (prevStepId: number, targetStepId: number) => void; + | +
+ -
+ |
+ + Event fires when the stepper demands to change step, but linear option prevents it. + | +
+ Use horizontally aligned timeline component to show a series of data in a chronological order. +
+ + + {{< twsnippet/demo-iframe id="example1" iframe="/components/stepper/examples/stepper-basic-example" title="Stepper Basic Example" >}} + + + ++ Help us spread the word about Tailwind Elements for React (TER) + + + + +
++ If you enjoy the project, help it grow & find more contributors by sharing + it with your peers. Every share counts, thank you! +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Use the activeStep
prop to control the stepper.
+
+ Add type='vertical'
to change stepper orientation.
+
+ Add noEditable
to disable editing a completed step.
+
+ Add linear
to enable step validation before proceeding to next step.
+
+ Use customValidation
to enable custom step validation before proceeding to next step.
+
+ If you are looking for more advanced options, try + Bootstrap Stepper + from MDBootstrap. +
+ diff --git a/site/static/search-react.json b/site/static/search-react.json index 4d72ed4..cb4c4c7 100644 --- a/site/static/search-react.json +++ b/site/static/search-react.json @@ -137,6 +137,12 @@ "keywords": ["loading"], "category": "Components" }, + { + "href": "/docs/react/components/stepper/", + "name": "Stepper", + "keywords": ["stepper", "progress", "steps", "wizard"], + "category": "Components" + }, { "href": "/docs/react/forms/checkbox/", "name": "Checkbox", diff --git a/src/demo/pages.tsx b/src/demo/pages.tsx index ed11b84..9271c70 100644 --- a/src/demo/pages.tsx +++ b/src/demo/pages.tsx @@ -58,6 +58,7 @@ import ToastsPage from "./pages/components/toasts/ToastsPage"; import SelectPage from "./pages/forms/select/SelectPage"; import CarouselPage from "./pages/components/carousel/CarouselPage"; import VideoCarouselPage from "./pages/components/video-carousel/VideoCarouselPage"; +import StepperPage from "./pages/components/stepper/StepperPage"; //examples pages import ButtonExamples from "./pages/components/buttons/exampleList"; @@ -94,6 +95,7 @@ import ToastsExamples from "./pages/components/toasts/exampleList"; import SelectExamples from "./pages/forms/select/exampleList"; import CarouselExamples from "./pages/components/carousel/exampleList"; import VideoCarouselExamples from "./pages/components/video-carousel/exampleList"; +import StepperExamples from "./pages/components/stepper/exampleList"; interface Pages { name: string; @@ -197,6 +199,11 @@ const componentsPages: Pages[] = [ path: "/components/video-carousel", element:+ After changing the active step, the previous steps can't be accessed + anymore. +
++ Lorem ipsum dolor, sit amet consectetur adipisicing elit. Pariatur, + tempora esse iusto tempore quod, aspernatur incidunt minima magnam, + quaerat aut vel expedita illum molestias repellendus asperiores id + suscipit saepe. Maxime. +
++ Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam + voluptatum, quod, voluptate quia, ipsam illum quibusdam dolorum + voluptatibus laboriosam quae voluptates? Quisquam, voluptatibus + voluptas. Quisquam, voluptatibus voluptas. Quisquam, voluptatibus + voluptas. +
+