react-stepper icon indicating copy to clipboard operation
react-stepper copied to clipboard

feature request: support component as `title` value

Open bdkent opened this issue 7 years ago • 2 comments

It would be nice if the step title could officially support arbitrary components rather than just strings, for instance to support simple icons (like font awesome) as part of the title.

For example:

title: (
    <span>
        <i class="fa fa-smile-o" />
        Hello
    </span>
)

It technically works now, but I get the warning: Failed prop type: Invalid prop `title` of type `object` supplied to `Step`, expected `string`.

bdkent avatar Jul 18 '17 18:07 bdkent

I agree this would be a nice feature to have. I will look into it sometime within the next week or two and let you know what I come up with. I do have a feeling that styling the circles with the icons may be difficult. The icons will most likely have to be at a fixed size. I've tried in the past enlarging the font of the text inside the circle and the bars adjacent to the circles get off-centered very quickly. In summary, adding icons may not be hard to do, but allowing styles to adjust according to the size of each icon may cause some issues.

claytn avatar Jul 19 '17 14:07 claytn

I'm also encountering this problem as I supply an entire button as title. It works perfectly, but I get the annoying proptype warning. I don't think you need to concern yourself with how the circle looks, as the title is shown below the circle and not inside it. From my point of view you can just enable object as proptype and it seems to work fine. Thanks for a great and easy to use package!

joakimlustig avatar Jan 18 '18 11:01 joakimlustig