UXP
v2.0.0
v2.0.0
  • Introduction
    • Welcome
    • Understanding the Portal
    • Getting Started
  • Releases
  • Interface Types
    • Widgets
  • Interface Guidelines
    • Lists
  • Interacting with Lucy
    • Real-Time Communication
  • Interface Guidelines
  • Custom Styles and CSS
  • Publishing your UIs
    • Bundles
  • lucy-xp
  • Components
    • AsyncButton
    • AutoCompleteInput
    • BarChartLoader
    • Button
    • CRUDComponent
    • CalendarComponent
    • Checkbox
    • ColorPallet
    • ColorPicker
    • ConfirmButton
    • DataGrid
    • DataList
    • DataTable
    • DatePicker
    • DateRangePicker
    • DateTimePicker
    • DefaultLoader
    • DonutChartLoader
    • DropDownButton
    • DynamicForm
    • DynamicSelect
    • FileInput
    • FilterPanel
    • FormFeedback
    • FormField
    • GaugeLoader
    • HeatmapChartLoader
    • HorizontalScrollList
    • IconButton
    • Input
    • ItemCard
    • ItemListCard
    • Label
    • LinkButtonWidget
    • LinkWidgetContainer
    • Loading
    • LoadingSpinner
    • LocalizationForm
    • LocalizationFormModal
    • MapComponent
    • Modal
    • ModalWizard
    • MultiSelect
    • NotificationBlock
    • PieChartComponent
    • Popover
    • PortalContainer
    • ProfileImage
    • RadialGauge
    • SampleDataLabel
    • SearchBox
    • Select
    • SideBar
    • SpaceworxDescriptionTag
    • TabComponent
    • TableComponent
    • TextArea
    • ThemeChanger
    • TimePicker
    • TimeRangePicker
    • TitleBar
    • ToggleFilter
    • Tooltip
    • TreeViewSelectInput
    • TrendChartComponent
    • UserProfile
    • WidgetContainerBlock
    • WidgetWrapper
    • Wizard
  • Hooks
    • useAlert
    • useDebounce
    • useEffectWithPolling
    • useEventSubscriber
    • useFields
    • useMessageBus
    • useResizeEffect
    • useToast
    • useUpdateWidgetProps
  • Types
    • ActionResponse
    • CRUDComponentInstanceProps
    • CRUDComponentProps
    • Column
    • DynamicFormFieldProps
    • DynamicFormProps
    • ExtendedFormProps
    • FieldsHook
    • FormProps
    • FormSectionProps
    • FormValue
    • IAlertResult
    • IAnimation
    • IAutoCompleteInputInstanceProps
    • IButtonSize
    • IButtonType
    • IBuyOnSpaceworxButtonProps
    • ICalendarComponentProps
    • ICallback
    • ICheckboxInstanceProps
    • ICheckboxType
    • ICircleBound
    • IColorPalletProps
    • IColorPickerPosition
    • IColorPickerProps
    • IColorTypes
    • IContentFunction
    • IDataFunction
    • IDataItem
    • IDataTableColumn
    • IDatePickerProps
    • IDateRangePickerProps
    • IDateTimePickerProps
    • IDivIconInterface
    • IDropDownButtonPosition
    • IDropDownButtonProps
    • IDynamicSelectDataFunction
    • IEventDispatcher
    • IEventSubscriber
    • IFileInputInstanceProps
    • IFileInputProps
    • IGaugeProps
    • IHeatmapConfiguration
    • IHeatmapPoint
    • IInputInstanceProps
    • IInputType
    • ILanguage
    • ILocalisationFormModalInstanceProps
    • ILocalisationFormModalProps
    • ILocalisationFormProps
    • IMarker
    • IMessage
    • IModalWizardProps
    • IModalWizardStep
    • IModalWizardStepProps
    • IMultiSelectProps
    • IPolygonBound
    • IPopoverPosition
    • IPopoverProps
    • IPortalContainerProps
    • IPosition
    • IPreviewDetails
    • IProfileProps
    • IRegion
    • IRemove
    • IRenderMarkerPopup
    • IRenderMarkerTooltip
    • ISampleDataLabelProps
    • ISearchBoxInstanceProps
    • ISelectProps
    • ISidebarProps
    • ISize
    • ISpaceworxDescriptionTagProps
    • IStaticImage
    • ITextAreaInstanceProps
    • IThemeChangerProps
    • ITitleFunc
    • IToast
    • IToastResult
    • IToggleOption
    • ITooltipPosition
    • ITooltipProps
    • IUseEffectWithPolling
    • IUseUpdateWidgetProps
    • IWidgetContainerBlockProps
    • IWidgetPreloaderLoaderProps
    • IWidgetWrapperProps
    • IWizardStep
    • IWizardStepProps
    • ListProps
    • MessageBusHook
    • PaginationProps
    • RenderCustomFormView
    • ResizeEffectHook
    • TabComponentProps
    • TabComponentStyles
    • TableComponentProps
    • ToastHook
    • TreeViewSelectInputInstanceProps
    • TreeViewSelectInputProps
    • regionType
Powered by GitBook
On this page
  • Installation
  • Examples
  • Properties
  • title
  • icon
  • iconPosition
  • className
  • onClick
  • loading
  • loadingTitle
  • active
  • disabled
  • styles
  • iconStyles
  • useLoadingSpinner
  • type
  1. Components

Button

This is a basic button component.

Installation

import {Button} from 'uxp/components';

Examples

<Button
     title="Click"
     onClick={() => {alert("Clicked")}}
 />
<Button
     title="Click"
     onClick={() => {alert("Clicked")}}
     icon="https://static.iviva.com/images/lucy-logo.svg"
     loading={isLoading}
     loadingTitle="Loading..."
     className="custom-css-class"
/>
<Button
     title='Save'
     loadingTitle='Saving...'
     useLoadingSpinner={true}
/>

Properties

Name
Type
Description

title

string

The caption for the button

icon

string

Button icon. you can either use a url or fontawesome icon Here is a example for using fontawesome icons icon={'fas save'}

iconPosition

'left' | 'right'

position of the icon

className

string

Any extra css classes to add to the button

onClick

(e?: React.MouseEvent) => void

The callback that gets invoked when the button is clicked

loading

boolean

Set this to true to show the button in its 'loading...' state. In this state, an animation will be shown indicating that work is going on and the user will not be able to click the button

loadingTitle

string

The caption to show on the button when its in loading state

active

boolean

to mark the button as active this will highlight the button

disabled

boolean

to disable the button

styles

React.CSSProperties

any custom inline styles to the button

iconStyles

React.CSSProperties

any custom inline styles for the icon container

useLoadingSpinner

boolean

show loading spinners in place of icons (even if the icon is not there it will show the spinner on the left sides) when the button is in loading state,

type

"button" | "submit" | "reset"

title


The caption for the button

type

string

icon


Button icon. you can either use a url or fontawesome icon

Here is a example for using fontawesome icons icon={'fas save'}

type

string

iconPosition


position of the icon

type

'left' | 'right'

className


Any extra css classes to add to the button

type

string

onClick


The callback that gets invoked when the button is clicked

type

(e?: React.MouseEvent) => void

loading


Set this to true to show the button in its 'loading...' state. In this state, an animation will be shown indicating that work is going on and the user will not be able to click the button

type

boolean

loadingTitle


The caption to show on the button when its in loading state

type

string

active


to mark the button as active this will highlight the button

type

boolean

disabled


to disable the button

type

boolean

styles


any custom inline styles to the button

type

React.CSSProperties

iconStyles


any custom inline styles for the icon container

type

React.CSSProperties

useLoadingSpinner


show loading spinners in place of icons (even if the icon is not there it will show the spinner on the left sides) when the button is in loading state,

type

boolean

type


type

"button" | "submit" | "reset"

PreviousBarChartLoaderNextCRUDComponent

Last updated 3 months ago