Button
Button components are Interactive Fields (Actions) used to trigger events, submit forms, or perform custom logic defined in the form configuration.
import { golemForm } from '@golemui/gui-shared';
export default golemForm().create({ form: [ { uid: 'button_basic', kind: 'action', type: 'button', label: 'Click Me', }, ],});{ "form": [ { "uid": "button_basic", "kind": "action", "type": "button", "label": "Click Me" } ]}Use these props to customize your Button component.
| 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 { golemForm } from '@golemui/gui-shared';
export default golemForm().create({ form: [ { uid: 'button_outlined', kind: 'action', type: 'button', label: 'Click Me', props: { variant: 'outlined', }, }, ],});{ "form": [ { "uid": "button_outlined", "kind": "action", "type": "button", "label": "Click Me", "props": { "variant": "outlined" } } ]}import { golemForm } from '@golemui/gui-shared';
export default golemForm().create({ form: [ { uid: 'button_link', kind: 'action', type: 'button', label: 'Click Me', props: { variant: '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 { golemForm } from '@golemui/gui-shared';
export default golemForm().create({ form: [ { kind: 'action', type: 'button', label: 'Save', props: { icon: 'save', }, }, ],});{ "form": [ { "uid": "", "kind": "action", "type": "button", "label": "Save", "props": { "icon": "save" } } ]}Button with Icon (Right)
Section titled “Button with Icon (Right)”import { golemForm } from '@golemui/gui-shared';
export default golemForm().create({ form: [ { kind: 'action', type: 'button', label: 'Save', props: { icon: 'save', iconPosition: 'right', }, }, ],});{ "form": [ { "uid": "", "kind": "action", "type": "button", "label": "Save", "props": { "icon": "save", "iconPosition": "right" } } ]}Icon Only Button
Section titled “Icon Only Button”import { golemForm } from '@golemui/gui-shared';
export default golemForm().create({ form: [ { kind: 'action', type: 'button', label: '', props: { icon: 'save', }, }, ],});{ "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 { golemForm } from '@golemui/gui-shared';
export default golemForm().create({ form: [ { uid: 'button_basic', kind: 'action', type: 'button', label: 'Click Me', disabled: true, }, ],});{ "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 Component 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>