Button Widget
The Button widget creates interactive clickable buttons that can trigger various actions within your interface. This widget provides extensive customization options for appearance, behavior, and functionality.
Overviewโ
The Button widget is a versatile UI component that allows users to trigger actions, submit forms, navigate between pages, or execute custom functions. It supports multiple visual styles, sizes, icons, and positioning options.

Basic Configurationโ
Global Settingsโ
Nameโ
- Field: Name
- Description: Display name for the button
- Type: Text input
- Usage: This text appears on the button and can be translated
Variable/Modelโ
- Field: Variable/Model
- Description: The data model or variable name associated with this button
- Type: Text input
- Usage: Used for data binding and referencing the button in scripts
Button Propertiesโ
Button Typeโ
- Field: Button Type
- Options:
primary- Primary action button (typically blue)success- Success/confirmation button (typically green)info- Informational button (typically light blue)warning- Warning button (typically orange/yellow)danger- Destructive action button (typically red)
- Default:
primary
Size Optionsโ
- Field: Size
- Options:
medium- Standard size buttonsmall- Smaller buttonmini- Minimal size button
- Default:
medium
Alignmentโ
- Field: Float
- Options:
left- Align button to the leftcenter- Center the buttonright- Align button to the right
- Default:
left
Icon Configurationโ
Prefix Iconโ
- Field: Prefix Icon
- Description: Icon displayed before the button text
- Type: Icon selector
- Usage: Choose from available icon library
Suffix Iconโ
- Field: Suffix Icon
- Description: Icon displayed after the button text
- Type: Icon selector
- Usage: Choose from available icon library

Actions Configurationโ
On Click Actionโ
The button supports comprehensive action configuration through a dedicated action editor:
- Script Execution: Execute custom JavaScript code
- Form Submission: Submit parent form data
- Navigation: Navigate to other pages or URLs
- API Calls: Make HTTP requests to external services
- Variable Updates: Modify interface variables
- Function Calls: Trigger predefined functions
Action Propertiesโ
- SF_input: Access to input context and current data
- SF_currentIndex: Current index in loop contexts
- Loading State: Automatic loading indicator during action execution
- Error Handling: Built-in error management
Validation and Visibilityโ
Screen-Based Validationโ
Configure button behavior across different screens/contexts:
Availableโ
- Description: Controls if the button exists in the interface
- Type: Boolean or conditional expression
- Default:
true
Visibleโ
- Description: Controls button visibility
- Type: Boolean or conditional expression
- Options:
- Simple toggle (true/false)
- Advanced conditional expression using variables
Requiredโ
- Description: Validation requirement (if part of form)
- Type: Boolean or conditional expression
- Context: Only applicable when button is part of form validation
Disabledโ
- Description: Controls if button is interactive
- Type: Boolean or conditional expression
- Effect: Button appears grayed out and non-clickable when disabled

Advanced Conditional Logicโ
Use conditional expressions with interface variables:

Styling and Appearanceโ
CSS Classesโ
- Field: Class
- Description: Custom CSS classes for styling
- Type: Text input (comma-separated)
- Usage: Apply custom styles or framework classes
Dynamic Classesโ
Advanced styling based on conditions:
- Dynamic Class Configuration: Apply classes conditionally
- State-Based Styling: Different styles for different states
- Responsive Classes: Classes that adapt to screen size
Layout Optionsโ
- Block vs Inline: Control button layout behavior
- Width: Custom width settings
- Height: Custom height settings

Usage Examplesโ
Basic Buttonโ

Button with Iconsโ
Action Button with Start Processโ

Conditional Buttonโ

Eventsโ
onClickโ
- Trigger: When button is clicked
- Context: Provides access to current data and form state
- Parameters:
SF_input: Input context objectSF_currentIndex: Current loop index (if applicable)
Loading Statesโ
- Automatic Loading: Button shows loading spinner during async operations
- Disabled During Loading: Button becomes non-interactive during action execution
Best Practicesโ
Action Designโ
- Clear Labels: Use descriptive button text
- Appropriate Types: Match button type to action severity
- Loading Feedback: Ensure async actions show loading states
- Error Handling: Implement proper error management
Visual Designโ
- Consistent Sizing: Use consistent sizes within form groups
- Logical Positioning: Place primary actions prominently
- Icon Usage: Use icons to enhance, not replace, clear text
- Color Coding: Follow standard color conventions
Accessibilityโ
- Keyboard Navigation: Ensure buttons are keyboard accessible
- Screen Reader Support: Use meaningful button names
- Focus Management: Proper focus handling in forms
- Contrast: Ensure sufficient color contrast
Form Integrationโ
- Validation Context: Consider button role in form validation
- Submit Behavior: Configure appropriate form submission
- Field Dependencies: Set up proper field relationships
Advanced Featuresโ
Form Integrationโ
- Submit Forms: Automatically submit parent forms
- Validation Triggers: Trigger form validation
- Field Dependencies: React to other form field changes
Loop Contextโ
- Loop Integration: Special handling within data loops
- Index Access: Access to current loop iteration
- Dynamic Properties: Properties that change per loop item
Custom Stylingโ
- Theme Integration: Integrates with interface theme settings
- Responsive Design: Adapts to different screen sizes
- Custom CSS: Support for custom styling
Troubleshootingโ
Common Issuesโ
- Button Not Responding: Check if disabled or validation conditions
- Actions Not Executing: Verify action configuration and permissions
- Styling Issues: Check CSS class conflicts
- Loading States: Ensure async actions are properly handled
Debuggingโ
- Browser Console: Check for JavaScript errors
- Network Tab: Monitor API calls during button actions
- State Inspection: Verify variable states and conditions