I need advice on library design So I'm working on...
# compose
z
I need advice on library design So I'm working on a color picker library, as all the existing solutions I find to be low quality I'm prioritizing being able to use components however possible One such component is a hue slider; I'm not sure whether I should create my own slider component or if it would be better to create individual m3, and m2 implementations for it or something else I haven't thought of, same with sliders for saturation, lightness, alpha
a
@zt without having the full picture of what you are trying to achieve with this library, my 2c: focus on publishing the lib first. this means focusing on the important problems your library is aiming to solve first. For v1 use a material component instead of building your own. You can probably copy/paste the source instead of depending on material (m2 might be simpler code btw but look both) After all the color picker problems are sorted, then worry about creating a custom slider or letting people bring in their own slider using a slot api, etc.
m
I'd be a fan of the slot API approach, but I'm trying to think in design-system-agnostic terms. I'd rather build a Foundation-and-slots composable with M2 and M3 wrappers, if I could.