diff --git a/ui/src/components/btn-dropdown/QBtnDropdown.json b/ui/src/components/btn-dropdown/QBtnDropdown.json index b9be32d0376..ce828a0784b 100644 --- a/ui/src/components/btn-dropdown/QBtnDropdown.json +++ b/ui/src/components/btn-dropdown/QBtnDropdown.json @@ -17,6 +17,12 @@ "category": "content|behavior" }, + "icon-size": { + "type": "String", + "desc": "Change icon size e.g. '16px' or '1rem'", + "category": "style" + }, + "dropdown-icon": { "extends": "icon" }, diff --git a/ui/src/components/btn/QBtn.js b/ui/src/components/btn/QBtn.js index c494236ea13..3650ca76378 100644 --- a/ui/src/components/btn/QBtn.js +++ b/ui/src/components/btn/QBtn.js @@ -303,7 +303,8 @@ export default createComponent({ h(QIcon, { name: props.icon, left: props.stack !== true && hasLabel.value === true, - role: 'img' + role: 'img', + ...(props.iconSize !== void 0 ? { size: props.iconSize } : {}), }) ) @@ -318,7 +319,8 @@ export default createComponent({ h(QIcon, { name: props.iconRight, right: props.stack !== true && hasLabel.value === true, - role: 'img' + role: 'img', + ...(props.iconSize !== void 0 ? { size: props.iconSize } : {}), }) ) } diff --git a/ui/src/components/btn/QBtn.json b/ui/src/components/btn/QBtn.json index e3bc857414a..c870a6d2db8 100644 --- a/ui/src/components/btn/QBtn.json +++ b/ui/src/components/btn/QBtn.json @@ -18,6 +18,12 @@ "category": "behavior" }, + "icon-size": { + "type": "String", + "desc": "Change icon size e.g. '16px' or '1rem'", + "category": "style" + }, + "dark-percentage": { "type": "Boolean", "desc": "Progress bar on the background should have dark color; To be used along with 'percentage' and 'loading' props", diff --git a/ui/src/components/btn/use-btn.js b/ui/src/components/btn/use-btn.js index 9b192d0074b..d496a682437 100644 --- a/ui/src/components/btn/use-btn.js +++ b/ui/src/components/btn/use-btn.js @@ -53,6 +53,7 @@ export const nonRoundBtnProps = { label: [ Number, String ], icon: String, iconRight: String, + iconSize: String, ...btnDesignOptions.reduce( (acc, val) => (acc[ val ] = Boolean) && acc,