Decathlon / vitamin-web

Decathlon Design System UI components for web applications
https://decathlon.github.io/vitamin-web
Apache License 2.0
279 stars 77 forks source link

bug: Allow label in Input to be a component rather than a string #1428

Closed Shyrro closed 1 year ago

Shyrro commented 1 year ago

Expected behavior In inputs, you usually want to add a llittle something to explain the field. Sometimes it's an icon with a tooltip, sometimes it's just italic text to explain that the field is optional or give more details.

Currently, it is not possible because the label on the Input is a string only ( even the name of the property is labelText ).

The idea is to add the ability to have a labelComponent. In order to not have a breaking, both could live together. If no label provided, we show labelComponent etc.