Is your feature request related to a problem? Please describe.
Currently, the UnpicImageProps type omits the style prop (React.CSSProperties), so TypeScript does not allow passing a style prop to the Image component, even though at runtime the image component forwards all other props to the underlying <img /> element. This leads to friction for users who want to pass inline styles, as they either have to use className only or cast style via as any, weakening type safety.
Describe the solution you'd like
Please consider allowing the style prop (style?: React.CSSProperties) in UnpicImageProps so that TypeScript users can pass custom styles to the Image component. This aligns with standard expectations for React image components, and does not break runtime behavior, only improves the developer experience.
If there is a specific reason for omitting style from the type definition, please document it clearly in the README or relevant docs.
Describe alternatives you've considered
- Using only
className and external CSS (not always desirable, especially for dynamic styles).
- Type casting with
as any to bypass TS error (not ideal and weakens type safety).
- Creating a wrapper component to reintroduce
style (boilerplate, should not be needed for common use cases).
Additional context
Many users expect to be able to use the style prop with React components. Supporting this natively improves the developer experience and aligns with React conventions.
Is your feature request related to a problem? Please describe.
Currently, the
UnpicImagePropstype omits thestyleprop (React.CSSProperties), so TypeScript does not allow passing astyleprop to theImagecomponent, even though at runtime the image component forwards all other props to the underlying<img />element. This leads to friction for users who want to pass inline styles, as they either have to useclassNameonly or caststyleviaas any, weakening type safety.Describe the solution you'd like
Please consider allowing the
styleprop (style?: React.CSSProperties) inUnpicImagePropsso that TypeScript users can pass custom styles to theImagecomponent. This aligns with standard expectations for React image components, and does not break runtime behavior, only improves the developer experience.If there is a specific reason for omitting
stylefrom the type definition, please document it clearly in the README or relevant docs.Describe alternatives you've considered
classNameand external CSS (not always desirable, especially for dynamic styles).as anyto bypass TS error (not ideal and weakens type safety).style(boilerplate, should not be needed for common use cases).Additional context
Many users expect to be able to use the
styleprop with React components. Supporting this natively improves the developer experience and aligns with React conventions.