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
  • content
  • position
  • showOnHover
  • keepShowingOnHover
  • className
  • onOpen
  • onClose
  • forceClose
  • disableScroll
  • autoPosition
  1. Components

DropDownButton

This component wraps another component and shows a tooltip for the component it is wrapping, whenever the user moves the mouse over it.

Installation

import {DropDownButton} from 'uxp/components';

Examples

Dropdown button basic example

 <DropDownButton
     content={() => <div>This is dropdown content</div>}
 >
     <button className="btn showcase" >Click to Show the dropdown</button>
 </DropDownButton>
Dropdown button example with options

 <DropDownButton
     content={() => <div>This is dropdown content</div>}
     position="left"
     showOnHover
 >
     <button className="btn showcase" >Click to Show the dropdown</button>
 </DropDownButton>
Dropdown button example with forceClose

 // Be carefull when handeling the state. `closePopup` state must reset to default (false) when the popup closes
 //state
 let [closePopup, setClosePopup] = React.useState(false)

 <DropDownButton
     content={() => <>
                 <h1>Click to close</h1>
                 <Button title="Click" onClick={() => { setClosePopup(true) }} />
             </>}
     onOpen={() => { }}
     onClose={() => { setClosePopup(false) }}
     forceClose={closePopup}
 >
     <button className="btn showcase" >Click to Show the dropdown</button>
 </DropDownButton>

Properties

Name
Type
Description

content

() => JSX.Element

The content to show inside the Dropdown

position

Where the dropdown should be placed relative to the element it is being displayed for default is right

showOnHover

boolean

If this is true dropdown will show on mouse over & hide n mouse out If this is false dropdown ill show on click

keepShowingOnHover

boolean

this will open the dropdown on hover and keep open even if user takes the mouse away Click on outside to close the dropdown

className

string

onOpen

() => void

callback function when the popup is open

onClose

() => void

callback function when the popup is closed

forceClose

boolean

an option to force close a popup

disableScroll

boolean

disable scroll on open dropdown true by default

autoPosition

boolean

if this is enabled drop down will be automatically positionsed within the view. better to use this option- it has been improved if enabled it will ignore the position param

content


The content to show inside the Dropdown

type

() => JSX.Element

content={() => <div>Dropdown Content</div>}

position


Where the dropdown should be placed relative to the element it is being displayed for default is right

type

showOnHover


If this is true dropdown will show on mouse over & hide n mouse out If this is false dropdown ill show on click

type

boolean

keepShowingOnHover


this will open the dropdown on hover and keep open even if user takes the mouse away Click on outside to close the dropdown

type

boolean

className


type

string

onOpen


callback function when the popup is open

type

() => void

onClose


callback function when the popup is closed

type

() => void

forceClose


an option to force close a popup

type

boolean

disableScroll


disable scroll on open dropdown true by default

type

boolean

autoPosition


if this is enabled drop down will be automatically positionsed within the view. better to use this option- it has been improved if enabled it will ignore the position param

type

boolean

PreviousDonutChartLoaderNextDynamicForm

Last updated 9 months ago

IDropDownButtonPosition
IDropDownButtonPosition