@fayegram-ai/faye-ui/patterns/floating-actions
Public exports and dependency-resolved component properties, with usage and rendering guidance.
Import
import { FloatingAction, FloatingActions } from '@fayegram-ai/faye-ui/patterns/floating-actions';Usage and behavior guide · API JSON
This entry declares a client boundary. Follow the rendering guide for framework integration.
Public exports
| Name | Kind | Resolved declaration type |
|---|---|---|
FloatingAction | value | ({ edge, className, ...props }: ButtonProps & { edge?: "start" | "end"; }) => import("react").JSX.Element |
FloatingActions | value | ({ label, items, edge, direction, openOnHover, triggerProps, positionerProps, popupProps, ...rootProps }: FloatingActionsProps) => import("react").JSX.Element |
FloatingActionItem | type | FloatingActionItem |
FloatingActionsProps | type | FloatingActionsProps |
FloatingAction
Public component; use the linked family guide for complete composition and behavior.
Dependency-resolved declaration properties. Common React/native HTML attributes are omitted from the table; use the full declaration and React/native references. Generic and union restrictions remain authoritative in TypeScript.
Properties
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ButtonState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
edge | No | "start" | "end" | undefined | See the usage contract and declaration. |
endIcon | No | ReactNode | See the usage contract and declaration. |
focusableWhenDisabled | No | boolean | undefined | Whether the button should be focusable when disabled. |
fullWidth | No | boolean | undefined | See the usage contract and declaration. |
nativeButton | No | boolean | undefined | Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>). |
pending | No | boolean | undefined | See the usage contract and declaration. |
pendingIndicator | No | ReactNode | See the usage contract and declaration. |
pendingPosition | No | "center" | "start" | "end" | undefined | Center replaces the label without a size change; start/end reserve an indicator slot. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState> | undefined | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. |
size | No | ButtonSize | undefined | See the usage contract and declaration. |
startIcon | No | ReactNode | Decorative slots keep artwork and labels centered with the same gap on either side. |
style | No | CSSProperties | ((state: ButtonState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
tone | No | ButtonTone | undefined | See the usage contract and declaration. |
variant | No | ButtonVariant | undefined | See the usage contract and declaration. |
FloatingActions
Accessible directional action dock, with Menu owning focus, hover and dismissal.
Dependency-resolved declaration properties. Common React/native HTML attributes are omitted from the table; use the full declaration and React/native references. Generic and union restrictions remain authoritative in TypeScript.
Properties
| Property | Required | Type | Meaning |
|---|---|---|---|
actionsRef | No | RefObject<MenuRootActions | null> | undefined | A ref to imperative actions. - unmount: Manually unmounts the menu. Call this after any externally controlled closing animation finishes. - close: When specified, the menu can be closed imperatively. |
closeParentOnEsc | No | boolean | undefined | When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. |
defaultOpen | No | boolean | undefined | Whether the menu is initially open. To render a controlled menu, use the open prop instead. |
defaultTriggerId | No | string | null | undefined | ID of the trigger that the menu is associated with. This is useful in conjunction with the defaultOpen prop to create an initially open menu. |
direction | No | "start" | "end" | "up" | "down" | undefined | See the usage contract and declaration. |
disabled | No | boolean | undefined | Whether the component should ignore user interaction. |
edge | No | "start" | "end" | undefined | See the usage contract and declaration. |
handle | No | MenuHandle<unknown> | undefined | A handle to associate the menu with a trigger. If specified, allows external triggers to control the menu's open state. |
highlightItemOnHover | No | boolean | undefined | Whether moving the pointer over items should highlight them. Disabling this prop allows CSS :hover to be differentiated from the :focus (data-highlighted) state. |
items | Yes | readonly FloatingActionItem[] | See the usage contract and declaration. |
label | Yes | string | See the usage contract and declaration. |
loopFocus | No | boolean | undefined | Whether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys. |
modal | No | boolean | undefined | Determines if the menu enters a modal state when open. - true: user interaction is limited to the menu: document page scroll is locked and pointer interactions on outside elements are disabled. - false: user interaction with the rest of the document is allowed. On touch devices, a true modal blocks outside taps but leaves the page scrollable unless the popup spans nearly the full viewport width, matching native iOS behavior. Nested menus ignore this prop, and menus opened by hover are never modal. |
onOpenChange | No | ((open: boolean, eventDetails: MenuRoot.ChangeEventDetails) => void) | undefined | Event handler called when the menu is opened or closed. |
onOpenChangeComplete | No | ((open: boolean) => void) | undefined | Event handler called after any animations complete when the menu is opened or closed. |
open | No | boolean | undefined | Whether the menu is currently open. |
openOnHover | No | boolean | undefined | See the usage contract and declaration. |
popupProps | No | (Omit<MenuPopupProps, "ref"> & RefAttributes<HTMLDivElement> & { variants?: { readonly size?: import("packages/faye-ui/dist/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("packages/faye-ui/dist/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefined; }) | undefined | See the usage contract and declaration. |
positionerProps | No | (Omit<MenuPositionerProps, "ref"> & RefAttributes<HTMLDivElement> & { variants?: { readonly size?: import("packages/faye-ui/dist/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("packages/faye-ui/dist/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefined; }) | undefined | See the usage contract and declaration. |
triggerId | No | string | null | undefined | ID of the trigger that the menu is associated with. This is useful in conjunction with the open prop to create a controlled menu. There's no need to specify this prop when the menu is uncontrolled (that is, when the open prop is not set). |
triggerProps | No | (MenuTriggerProps<unknown> & RefAttributes<HTMLElement> & { variants?: { readonly size?: import("packages/faye-ui/dist/contracts/visual-variants").VisualVariant<"menu", "size"> | undefined; readonly tone?: import("packages/faye-ui/dist/contracts/visual-variants").VisualVariant<"menu", "tone"> | undefined; } | undefined; }) | undefined | See the usage contract and declaration. |
Defaults and customization
Defaults and native behavior are documented in the linked family guide. This reference does not infer a default from an optional property.
Use semantic tokens, public part hooks and customization sheets. Keep visual configuration separate from application state.
State, events and accessibility
For interactive controls, pair a controlled value/open prop with its corresponding change callback; default props initialize uncontrolled state. Keep application validation and submission policy explicit. Name controls with visible labels, name icon-only actions on the button, and preserve focus and dismissal behavior when replacing parts. Use native form names and submit/reset types where supported. See the usage guide for component-specific behavior and live examples.
Declaration authority
Generated from packages/faye-ui/dist/patterns/floating-actions.d.ts after the semantic package build. Common native/React attributes are intentionally omitted from property tables. Generic overloads, discriminated unions and complete inherited attributes remain authoritative in installed TypeScript declarations. React DOM attributes and Base UI component contracts describe the inherited foundations.