| Name | Type | Default |
|
disabled
# |
boolean
|
false
|
Enables or disables the button.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return <JqxButton ref={myButton} width={120} height={40} value={'Click Me!'} disabled={true} />;
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
height
# |
number | string
|
null
|
Sets or gets the button's height.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return <JqxButton ref={myButton} width={120} height={40} value={'Click Me!'} />;
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
imgSrc
# |
string
|
''
|
Sets or gets the button's image source.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return (
<JqxButton
ref={myButton}
width={120}
height={40}
value={'Click Me!'}
imgPosition={'left'}
imgSrc={'https://jqwidgets.com/jquery-widgets-demo/images/andrew.png'}
imgHeight={14}
imgWidth={14}
/>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
imgWidth
# |
number | string
|
16
|
Sets or gets the button's image width.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return (
<JqxButton
ref={myButton}
width={120}
height={40}
value={'Click Me!'}
imgPosition={'left'}
imgSrc={'https://jqwidgets.com/jquery-widgets-demo/images/andrew.png'}
imgHeight={14}
imgWidth={14}
/>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
imgHeight
# |
number | string
|
16
|
Sets or gets the button's image height.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return (
<JqxButton
ref={myButton}
width={120}
height={40}
value={'Click Me!'}
imgPosition={'left'}
imgSrc={'https://jqwidgets.com/jquery-widgets-demo/images/andrew.png'}
imgHeight={14}
imgWidth={14}
/>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
imgPosition
# |
ButtonPositions
|
'center'
|
ButtonPositions: "left" | "center" | "right" | "top" | "bottom" | "topLeft" | "bottomLeft" | "topRight" | "bottomRight"
Sets or gets the button's image position. Possible values: "left", "top", "center", "bottom", "right", "topLeft", "bottomLeft", "topRight", "bottomRight".
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return (
<JqxButton
ref={myButton}
width={120}
height={40}
value={'Click Me!'}
imgPosition={'left'}
imgSrc={'https://jqwidgets.com/jquery-widgets-demo/images/andrew.png'}
/>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
roundedCorners
# |
ButtonRoundedCorners
|
all
|
ButtonRoundedCorners: "top" | "bottom" | "all" | "left" | "right" | "top-right" | "top-left" | "bottom-right" | "bottom-left"
Enables or disables the rounded corners functionality. This property setting has effect in browsers which support CSS border-radius.
Possible Values:
'all' - for all corners
'top'- for top corners
'bottom' - for bottom corners
'left' - for left corners
'right' - for right corners
'top-right' - for top right corners
'top-left' - for top left corners
'bottom-right' - for bottom right corners
'bottom-left' - for bottom left corners
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return (
<JqxButton
ref={myButton}
width={120}
height={40}
value={'Click Me!'}
roundedCorners={'top'}
/>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
rtl
# |
boolean
|
false
|
Sets or gets a value indicating whether widget's elements are aligned to support locales using right-to-left fonts.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return <JqxButton ref={myButton} width={120} height={40} value={'Click Me!'} rtl={true} />;
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
enableDefault
# |
boolean
|
true
|
import { createRoot } from "react-dom/client";
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return <JqxButton ref={myButton} width={120} height={40} value={'Click Me!'} enableDefault={false} />;
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
cursor
# |
string
|
'arrow'
|
import { createRoot } from "react-dom/client";
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return <JqxButton ref={myButton} width={120} height={40} value={'Click Me!'} cursor={'arrow'} />;
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
textPosition
# |
ButtonPositions
|
''
|
ButtonPositions: "left" | "center" | "right" | "top" | "bottom" | "topLeft" | "bottomLeft" | "topRight" | "bottomRight"
Sets or gets the button's text position. Possible values: "left", "top", "center", "bottom", "right", "topLeft", "bottomLeft", "topRight", "bottomRight".
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return (
<JqxButton
ref={myButton}
width={120}
height={40}
value={'Click Me!'}
textPosition={'right'}
/>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
textImageRelation
# |
ButtonTextImageRelation
|
'overlay'
|
ButtonTextImageRelation: "imageBeforeText" | "imageAboveText" | "textAboveImage" | "textBeforeImage" | "overlay"
Sets or gets the button's text image relation. Possible values: "imageBeforeText", "imageAboveText", "textAboveImage", "textBeforeImage" and "overlay".
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return (
<JqxButton
ref={myButton}
width={120}
height={40}
value={'Click Me!'}
imgPosition={'left'}
imgSrc={'https://jqwidgets.com/jquery-widgets-demo/images/andrew.png'}
textImageRelation={'imageBeforeText'}
/>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
theme
# |
string
|
''
|
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return (
<JqxButton ref={myButton} width={120} height={40} value={'Click Me!'} theme={'material'} />
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
template
# |
ButtonTemplate
|
'default'
|
ButtonTemplate: "default" | "primary" | "success" | "warning" | "danger" | "inverse" | "info" | "link"
Determines the button's template as an alternative of the default styles.
Possible Values:
'default' - the default button's template. The button's style depends only on its "theme" property value.
'primary' - dark blue button for extra visual weight.
'success' - green button for successful or positive action.
'warning' - orange button which indicates caution.
'danger' - red button which indicates a dangerous or negative action.
'inverse' - dark gray button, not tied to a semantic action or use.
'info' - blue button, not tied to a semantic action or use.
'link' - making it look like a link .
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return (
<JqxButton
ref={myButton}
width={120}
height={40}
value={'Click Me!'}
template={'success'}
/>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
width
# |
number | string
|
null
|
Sets ot gets the button's width.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return <JqxButton ref={myButton} width={240} height={40} value={'Click Me!'} />;
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
value
# |
string
|
''
|
Sets or gets the button's value.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
return <JqxButton ref={myButton} width={120} height={40} value={'Button'} />;
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
|
|
click
# |
Event
|
|
This event is triggered when the button is clicked.
Code examples #
Bind to the click event of jqxButton.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
const onClick = (_e: Event): void => {
alert('do something...');
};
return (
<JqxButton ref={myButton} onClick={onClick} width={120} height={40} value={'Click Me!'} />
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
|
| Name | Arguments | Return Type |
|
destroy
# |
None
|
|
Destroys the widget.
import { createRoot } from 'react-dom/client';
import { useEffect, useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
useEffect(() => {
myButton.current!.destroy();
}, []);
return <JqxButton ref={myButton} width={120} height={40} value={'Click Me!'} />;
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
focus
# |
None
|
|
Focuses the widget.
import { createRoot } from 'react-dom/client';
import { useEffect, useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
useEffect(() => {
myButton.current!.focus();
}, []);
return <JqxButton ref={myButton} width={120} height={40} value={'Click Me!'} />;
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
render
# |
None
|
|
Renders the widget.
import { createRoot } from 'react-dom/client';
import { useEffect, useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
useEffect(() => {
myButton.current!.render();
}, []);
return <JqxButton ref={myButton} width={120} height={40} value={'Click Me!'} />;
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
val
# |
value
|
|
Sets or gets the value.
import { createRoot } from 'react-dom/client';
import { useEffect, useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons';
function App() {
const myButton = useRef<JqxButton>(null);
useEffect(() => {
myButton.current!.val('New Text');
}, []);
return <JqxButton ref={myButton} width={120} height={40} value={'Click Me!'} />;
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|