Skip to content

Commit 16f9203

Browse files
authored
Expose rel attribute on Button (#921)
1 parent 0f297a4 commit 16f9203

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/button/Button.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const Button = props => {
3030
color,
3131
outline,
3232
onClick,
33+
rel,
3334
...otherProps
3435
} = props;
3536

@@ -61,6 +62,7 @@ const Button = props => {
6162
name={useLink ? undefined : name}
6263
value={useLink ? undefined : value}
6364
className={class_name || className}
65+
rel={useLink ? rel : undefined}
6466
{...omit(['n_clicks_timestamp'], otherProps)}
6567
data-dash-is-loading={
6668
(loading_state && loading_state.is_loading) || undefined
@@ -223,7 +225,12 @@ Button.propTypes = {
223225
* with the form data. This value is passed to the server in params when the
224226
* form is submitted.
225227
*/
226-
value: PropTypes.string
228+
value: PropTypes.string,
229+
230+
/**
231+
* Set the rel attribute when Button is being used as a Link.
232+
*/
233+
rel: PropTypes.string
227234
};
228235

229236
export default Button;

0 commit comments

Comments
 (0)