Skip to content

Commit f7a2648

Browse files
authored
Merge pull request #565 from facultyai/button-value
Add name and value props to Button
2 parents dc69838 + b3d32b5 commit f7a2648

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/components/Button.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const Button = props => {
2323
target,
2424
type,
2525
download,
26+
name,
27+
value,
2628
...otherProps
2729
} = props;
2830

@@ -45,6 +47,8 @@ const Button = props => {
4547
href={disabled ? null : href}
4648
disabled={disabled}
4749
download={useLink ? download : null}
50+
name={useLink ? null : name}
51+
value={useLink ? null : value}
4852
{...omit(['n_clicks_timestamp'], otherProps)}
4953
data-dash-is-loading={
5054
(loading_state && loading_state.is_loading) || undefined
@@ -193,7 +197,20 @@ Button.propTypes = {
193197
/**
194198
* Indicates that the hyperlink is to be used for downloading a resource.
195199
*/
196-
download: PropTypes.string
200+
download: PropTypes.string,
201+
202+
/**
203+
* The name of the button, submitted as a pair with the button’s value as part
204+
* of the form data.
205+
*/
206+
name: PropTypes.string,
207+
208+
/**
209+
* Defines the value associated with the button’s name when it’s submitted
210+
* with the form data. This value is passed to the server in params when the
211+
* form is submitted.
212+
*/
213+
value: PropTypes.string
197214
};
198215

199216
export default Button;

0 commit comments

Comments
 (0)