kobalte icon indicating copy to clipboard operation
kobalte copied to clipboard

New component - Stepper

Open Waishnav opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. As of now we don't have stepper component. This component is very useful for application where we have to show multi step forms. We can have composable ui component similar to mantine.dev's stepper or ark.ui's step component

Describe the solution you'd like A composable stepper component with the following features:

  • Progress tracking through multiple steps
  • Support for both controlled and uncontrolled modes
  • Step indicators with completion states
  • Navigation controls (prev/next)

basic example of usage of this component

function Demo() {
  return (
    <Stepper.Root count={3} defaultActiveStep={0}>
      <Stepper.List>
        <For each={['Account', 'Details', 'Complete']}>
          {(label, index) => (
            <Stepper.Item index={index()}>
              <Stepper.Trigger>
                <Stepper.Indicator>{index() + 1}</Stepper.Indicator>
                <span>{label}</span>
              </Stepper.Trigger>
              <Stepper.Separator />
            </Stepper.Item>
          )}
        </For>
      </Stepper.List>

      <Stepper.Content index={0}>Account details...</Stepper.Content>
      <Stepper.Content index={1}>Personal info...</Stepper.Content>
      <Stepper.Content index={2}>Review details...</Stepper.Content>

      <Stepper.CompletedContent>
        All steps completed!
      </Stepper.CompletedContent>

      <div>
        <Stepper.PrevTrigger>Back</Stepper.PrevTrigger>
        <Stepper.NextTrigger>Next</Stepper.NextTrigger>
      </div>
    </Stepper.Root>
  );
}

Describe alternatives you've considered

  • Using a tab component with custom styling but it lacks proper step tracking and navigation
  • Using a progress indicator with manual state management. but we can't show the step count, we relies on progress visually

Additional context I'm taking inspiration from these two ui library mantine.dev and arc.ui for its implementation. Would love to hear any feedback and suggestion.

Waishnav avatar Nov 05 '24 12:11 Waishnav

Hey @jer3m01 and team! 😊

I was looking through the library docs but couldn’t find a Stepper component. so I built it's first version, would love to hear your thoughts and review on the PR #523

Again thanks for your guidance and for all the hard work that goes into this library! for my first solidjs project, this library really help me move fast with building ui components. :)

Waishnav avatar Nov 10 '24 19:11 Waishnav