Button
Button widgets are Interactive Fields (Actions) used to trigger events, submit forms, or perform custom logic defined in the form configuration.
import { gui } from '@golemui/gui-shared';
export default [ gui.actions.button({ label: 'Click Me', uid: 'button_basic', }),];{ "form": [ { "uid": "button_basic", "kind": "action", "type": "button", "label": "Click Me" } ]}Use these props to customize your Button widget.
| prop | type | description |
|---|---|---|
label | string | The text displayed inside the button (Optional if icon is present) |
disabled | boolean | Whether the button is interactive or not |
variant | 'filled' | 'outlined' | 'link' | Optional. Button style variant (Default: filled) |
icon | string | Optional CSS class for an icon (Implementation may vary by framework) |
iconPosition | 'left' | 'right' | Optional. Position of the icon relative to the label (Default: left) |
Variants
Section titled “Variants”Buttons support three style variants: filled (default), outlined, and link.
Outlined
Section titled “Outlined”import { gui } from '@golemui/gui-shared';
export default [ gui.actions.button({ variant: 'outlined', label: 'Click Me', uid: 'button_outlined', }),];{ "form": [ { "uid": "button_outlined", "kind": "action", "type": "button", "label": "Click Me", "props": { "variant": "outlined" } } ]}import { gui } from '@golemui/gui-shared';
export default [ gui.actions.button({ variant: 'link', label: 'Click Me', uid: 'button_link', }),];{ "form": [ { "uid": "button_link", "kind": "action", "type": "button", "label": "Click Me", "props": { "variant": "link" } } ]}Buttons support icons that can be positioned to the left or right of the label. The label itself is optional if an icon is provided.
Button with Icon (Left)
Section titled “Button with Icon (Left)”import { gui } from '@golemui/gui-shared';
export default [ gui.actions.button({ icon: 'save', label: 'Save', }),];{ "form": [ { "uid": "", "kind": "action", "type": "button", "label": "Save", "props": { "icon": "save" } } ]}Button with Icon (Right)
Section titled “Button with Icon (Right)”import { gui } from '@golemui/gui-shared';
export default [ gui.actions.button({ icon: 'save', iconPosition: 'right', label: 'Save', }),];{ "form": [ { "uid": "", "kind": "action", "type": "button", "label": "Save", "props": { "icon": "save", "iconPosition": "right" } } ]}Icon Only Button
Section titled “Icon Only Button”import { gui } from '@golemui/gui-shared';
export default [ gui.actions.button({ icon: 'save', label: '', }),];{ "form": [ { "uid": "", "kind": "action", "type": "button", "label": "", "props": { "icon": "save" } } ]}Disabled State
Section titled “Disabled State”You can disable the button by setting the disabled property to true.
import { gui } from '@golemui/gui-shared';
export default [ gui.actions.button({ label: 'Click Me', disabled: true, uid: 'button_basic', }),];{ "form": [ { "uid": "button_basic", "kind": "action", "type": "button", "label": "Click Me", "disabled": true } ]}Styling
Section titled “Styling”Buttons can be styled as explained in the Styling Guide.
CSS Variables
Section titled “CSS Variables”Following you will find a list with the CSS Variables and a quick description of what you will style.
| CSS Variable | Description |
|---|---|
--gui-intent-primary | Background color of the button |
--gui-intent-primary-text | Color of the text inside the button |
--gui-intent-primary-hover | Background color on hover |
--gui-intent-primary-active | Background color when clicked |
--gui-radius-md | Border radius of the button |
Anatomy
Section titled “Anatomy”This is the anatomy of the Button Widget in case you want to use your CSS styles.
<div class="gui-widget"> <button type="button" class="gui-button" id="button_id"> Click Me </button></div>