CSSuiButton

CSSuiButton()

CSSUIBUTTON CSS-styled push-button backed by uihtml

Usage:

btn = CSSuiButton(parent) btn = CSSuiButton(parent, ‘Text’, ‘Save’, ‘Icon’, ‘icon.svg’, ‘Style’, ‘flat’) btn.Text = ‘Updated’; % live patch — no page reload

Inputs:

parent : graphics container - target uifigure/uipanel/uigrid – required

Name-Value Pairs:

‘Text’ : char - button label (default: ‘Button’) ‘Icon’ : char - SVG markup, SVG path data, .svg/.png/.jpg/… file path, or data URI (default: ‘’) ‘IconPosition’ : char - ‘top’ | ‘bottom’ | ‘left’ | ‘right’ (default: ‘top’) ‘IconSize’ : char - CSS size e.g. ‘18px’ or ‘1.5em’ (default: ‘1.2em’) ‘Shape’ : char - ‘rectangle’ | ‘square’ | ‘circle’ (default: ‘rectangle’) ‘IconOnlyWidth’ : char - CSS width below which text hides when Icon is set (default: ‘’) ‘ButtonPushedFcn’ : function handle - @(src, evt) callback (default: []) (plus all CSSBase name-value pairs)

Outputs:

btn : CSSuiButton handle

Notes

CSS element schema:
#css-root Outer sizing container (CSSBase-managed)

.cssui-button Widget-type class on #css-root

.css-control The <button> element

#cssbase-text Span holding the button text (live-patchable) .css-icon SVG or <img> icon element

.css-disabled On #css-root when Enabled=false

Custom CSS examples:

btn.CSS = ‘.css-control { text-transform: uppercase; }’; btn.CSS = ‘.css-icon { fill: #E53935; }’;

See also: CSSBase, CSSPreset, CSSuiLabel, CSSuiDropdown

∿∿∿ Prerau Laboratory MATLAB Codebase · sleepEEG.org ∿∿∿