Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/src/pages/components/cdk-components/button/api.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ const buttonPropsTable = () => {
</td>
<td>Uses on of the available button modes.</td>
</tr>
<tr>
<td>type: 'button' | 'reset' | 'submit'</td>
<td>
<code>'button'</code>
</td>
<td>This prop corresponds to the 'type' prop of the button in html.</td>
</tr>
<tr>
<td>label: string</td>
<td></td>
Expand Down
6 changes: 4 additions & 2 deletions lib/src/button/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const DxcButton = ({
mode = "primary",
disabled = false,
iconPosition = "before",
type = "button",
iconSrc = "",
icon,
onClick = "",
Expand All @@ -23,9 +24,10 @@ const DxcButton = ({

return (
<ThemeProvider theme={colorsTheme.button}>
<DxCButton margin={margin} mode={mode} disabled={disabled} iconPosition={iconPosition} size={size}>
<DxCButton type={type} margin={margin} mode={mode} disabled={disabled} iconPosition={iconPosition} size={size}>
<Button
disabled={disabled}
type={type}
disableRipple
aria-disabled={disabled ? true : false}
onClick={() => {
Expand Down Expand Up @@ -231,11 +233,11 @@ DxcButton.propTypes = {
label: PropTypes.string,
mode: PropTypes.oneOf(["primary", "secondary", "text"]),
disabled: PropTypes.bool,
theme: PropTypes.oneOf(["dark", "light"]),
iconPosition: PropTypes.oneOf(["after", "before"]),
onClick: PropTypes.func,
iconSrc: PropTypes.string,
icon: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
type: PropTypes.oneOf(["button", "reset", "submit"]),
};

export default DxcButton;