Floating UI Svelte
Please note this section will be the future home of the Floating UI Svelte integrateion guide, an upcoming open-source library from Skeleton Labs. While this project is in development, we have provided several Svelte-specific components to act as temporary substitutions. Note that these components will remain available until our next major release (Skeleton v4.x). However, the goal will be to replace these with Floating UI Svelte as soon as possible.
Components
Popover
Triggers an anchored popover when you click the trigger element. View API Reference.
Tooltip
Triggers an anchored popover when you hover the trigger element. View API Reference.
Combobox
Triggers an anchored popover list when you tap the arrow. Includes auto-suggestion via typeahead. View API Reference.
Modal
Generate modals or dialogs that require a user’s immediate attention. View API Reference.
Native Browser APIs
Skeleton will always favor native browser APIs over third-party libraries such as Floating UI Svelte. The following is a list of current and upcoming incoming APIs we will aim to support in the future, but are not quite standardized cross-browser yet.
API Reference
Popover
Property | Type | Description |
---|---|---|
open | boolean | |
arrow | boolean | |
base | string | |
classes | string | |
triggerBase | string | |
triggerBackground | string | |
triggerClasses | string | |
positionerBase | string | |
positionerZIndex | string | |
positionerClasses | string | |
contentBase | string | |
contentBackground | string | |
contentClasses | string | |
arrowBase | string | |
arrowBackground | string | |
arrowClasses | string | |
trigger | Snippet<[]> | |
content | Snippet<[]> | |
onclick | () => void | |
ids | Partial<{ anchor: string; trigger: string; content: string; title: string; description: string; closeTrigger: string; positioner: string; arrow: string; }> | |
modal | boolean | |
portalled | boolean | |
autoFocus | boolean | |
initialFocusEl | () => HTMLElement | |
closeOnInteractOutside | boolean | |
closeOnEscape | boolean | |
onOpenChange | (details: OpenChangeDetails) => void | |
positioning | PositioningOptions | |
open.controlled | boolean | |
getRootNode | () => Node | ShadowRoot | Document | |
dir | "ltr" | "rtl" | |
onEscapeKeyDown | (event: KeyboardEvent) => void | |
onPointerDownOutside | (event: PointerDownOutsideEvent) => void | |
onFocusOutside | (event: FocusOutsideEvent) => void | |
onInteractOutside | (event: InteractOutsideEvent) => void | |
persistentElements | (() => Element)[] | |
Tooltip
Property | Type | Description |
---|---|---|
open | boolean | |
base | string | |
classes | string | |
triggerBase | string | |
triggerBackground | string | |
triggerClasses | string | |
positionerBase | string | |
positionerZIndex | string | |
positionerClasses | string | |
contentBase | string | |
contentBackground | string | |
contentClasses | string | |
trigger | Snippet<[]> | |
content | Snippet<[]> | |
onmouseover | () => void | |
ids | Partial<{ trigger: string; content: string; arrow: string; positioner: string; }> | |
openDelay | number | |
closeDelay | number | |
closeOnPointerDown | boolean | |
closeOnEscape | boolean | |
closeOnScroll | boolean | |
closeOnClick | boolean | |
interactive | boolean | |
onOpenChange | (details: OpenChangeDetails) => void | |
aria-label | string | |
positioning | PositioningOptions | |
disabled | boolean | |
open.controlled | boolean | |
dir | "ltr" | "rtl" | |
getRootNode | () => ShadowRoot | Node | Document | |
Combobox
Property | Type | Description |
---|---|---|
data | { label: string; value: string; }[] | |
value | string[] | |
label | string | |
base | string | |
width | string | |
classes | string | |
labelBase | string | |
labelText | string | |
labelClasses | string | |
inputGroupBase | string | |
inputGroupInput | string | |
inputGroupButton | string | |
inputGroupArrow | string | |
inputGroupClasses | string | |
positionerBase | string | |
positionerZIndex | string | |
positionerClasses | string | |
contentBase | string | |
contentBackground | string | |
contentSpaceY | string | |
contentClasses | string | |
optionBase | string | |
optonFocus | string | |
optionHover | string | |
optionActive | string | |
optionClasses | string | |
arrow | Snippet<[]> | |
onclick | (event: Event) => void | |
open | boolean | |
open.controlled | boolean | |
ids | Partial<{ root: string; label: string; control: string; input: string; content: string; trigger: string; clearTrigger: string; item(id: string, index?: number): string; positioner: string; itemGroup(id: string | number): string; itemGroupLabel(id: string | number): string; }> | |
inputValue | string | |
name | string | |
form | string | |
disabled | boolean | |
readOnly | boolean | |
invalid | boolean | |
required | boolean | |
placeholder | string | |
highlightedValue | string | |
inputBehavior | "autohighlight" | "autocomplete" | "none" | |
selectionBehavior | "clear" | "replace" | "preserve" | |
autoFocus | boolean | |
openOnClick | boolean | |
openOnChange | boolean | ((details: InputValueChangeDetails) => boolean) | |
allowCustomValue | boolean | |
loopFocus | boolean | |
positioning | PositioningOptions | |
onInputValueChange | (details: InputValueChangeDetails) => void | |
onValueChange | (details: ValueChangeDetails<any>) => void | |
onHighlightChange | (details: HighlightChangeDetails<any>) => void | |
onOpenChange | (details: OpenChangeDetails) => void | |
translations | IntlTranslations | |
closeOnSelect | boolean | |
openOnKeyPress | boolean | |
scrollToIndexFn | (details: ScrollToIndexDetails) => void | |
composite | boolean | |
disableLayer | boolean | |
dir | "ltr" | "rtl" | |
getRootNode | () => ShadowRoot | Node | Document | |
onPointerDownOutside | (event: PointerDownOutsideEvent) => void | |
onFocusOutside | (event: FocusOutsideEvent) => void | |
onInteractOutside | (event: InteractOutsideEvent) => void | |
Modal
Property | Type | Description |
---|---|---|
open | boolean | |
base | string | |
classes | string | |
triggerBase | string | |
triggerBackground | string | |
triggerClasses | string | |
backdropBase | string | |
backdropBackground | string | |
backdropClasses | string | |
positionerBase | string | |
positionerDisplay | string | |
positionerJustify | string | |
positionerAlign | string | |
positionerPadding | string | |
positionerZIndex | string | |
positionerClasses | string | |
contentBase | string | |
contentBackground | string | |
contentClasses | string | |
transitionsBackdropIn | FadeParams | |
transitionsBackdropOut | FadeParams | |
transitionsPositionerIn | FlyParams | |
transitionsPositionerOut | FlyParams | |
trigger | Snippet<[]> | |
content | Snippet<[]> | |
onclick | () => void | |
ids | Partial<{ trigger: string; positioner: string; backdrop: string; content: string; closeTrigger: string; title: string; description: string; }> | |
trapFocus | boolean | |
preventScroll | boolean | |
modal | boolean | |
initialFocusEl | () => HTMLElement | |
finalFocusEl | () => HTMLElement | |
restoreFocus | boolean | |
onOpenChange | (details: OpenChangeDetails) => void | |
closeOnInteractOutside | boolean | |
closeOnEscape | boolean | |
aria-label | string | |
role | "dialog" | "alertdialog" | |
open.controlled | boolean | |
dir | "ltr" | "rtl" | |
getRootNode | () => Node | ShadowRoot | Document | |
onEscapeKeyDown | (event: KeyboardEvent) => void | |
onPointerDownOutside | (event: PointerDownOutsideEvent) => void | |
onFocusOutside | (event: FocusOutsideEvent) => void | |
onInteractOutside | (event: InteractOutsideEvent) => void | |
persistentElements | (() => Element)[] | |