Description
Browser
No response
Package version
3.0.1006
React version
19.0.0
Description
Hello Cloudscape team,
I am experiencing an issue with the Button component. According to your documentation ( Button API ), the Button component should accept a style prop of type ButtonProps.Style. However, when I try to use the style prop, TypeScript throws the following error:
Type '{ children: (string | number)[]; variant: "inline-link"; iconName: "status-warning"; onClick: () => void; style: { root: {}; }; }' is not assignable to type 'IntrinsicAttributes & ButtonProps & RefAttributes'.
Property 'style' does not exist on type 'IntrinsicAttributes & ButtonProps & RefAttributes'.ts(2322)
After importing the component:
import { Button } from "@cloudscape-design/components";
Here is a code snippet that reproduces the issue:
<Button
variant="inline-link"
iconName="status-warning"
onClick={() => { /* ... */ }}
style={{ root: {} }}
>
Example
</Button>
The Button component should accept the style prop as described in the documentation.
TypeScript reports that the style prop does not exist on the Button component.
Could you clarify if the documentation is incorrect, or if the type definitions and implementation are missing support for the style prop?
Source code
<Button
variant="inline-link"
iconName="status-warning"
onClick={() => { /* ... */ }}
style={{ root: {} }}
Example
Reproduction
<Button
variant="inline-link"
iconName="status-warning"
onClick={() => { /* ... */ }}
style={{ root: {} }}
Example
Code of Conduct
- I agree to follow this project's Code of Conduct
- I checked the current issues for duplicate problems