Set the disabled state in React Button component
7 Aug 20231 minute to read
Button component can be enabled/disabled by giving disabled
property. To disable Button component, the disabled
property can be set as true
.
The following example demonstrates Button in disabled
state.
import { enableRipple } from '@syncfusion/ej2-base';
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
import * as React from 'react';
import * as ReactDom from 'react-dom';
enableRipple(true);
function App() {
return (<div>
<ButtonComponent disabled={true}>Disabled</ButtonComponent>
</div>);
}
export default App;
ReactDom.render(<App />, document.getElementById('button'));
import { enableRipple } from '@syncfusion/ej2-base';
import {ButtonComponent} from '@syncfusion/ej2-react-buttons';
import * as React from 'react';
import * as ReactDom from 'react-dom';
enableRipple(true);
function App() {
return (
<div>
<ButtonComponent disabled={true}>Disabled</ButtonComponent>
</div>
);
}
export default App;
ReactDom.render(<App />,document.getElementById('button'));