Actionsduskmoonimplemented6 demos

FloatButton

FloatButton keeps a high-priority shortcut available over the page content.

Import@duskmoon-dev/components/float-button
11API sections
24documented props
4behavior scenarios
Key API
icontypeshapetooltipdescriptionbadge

Usage

When to use

  • Use it when users need to move between sections, pages, steps, or contextual actions.
  • Expose current and disabled state so navigation remains clear to keyboard and screen-reader users.

Implementation notes

StylesheetImport @duskmoon-dev/components/styles.css once in the app or docs shell.
StateStart with default props for static examples, then switch to controlled props when state must be shared.
ThemeThe preview inherits the active DuskMoon data-theme value from the docs layout.

Features

Wayfinding

Covers the route, section, step, or action-list patterns that help users move through an interface.

Current state

Shows selected, active, open, or current props where the component exposes them.

Primary API surface

FloatButton is most often configured through `icon`, `type`, `shape`, `tooltip`.

Covered behavior

Renders icon, type, shape, description, tooltip, and badge

Feature Demos

Feature demos are authored for the component page, then supplemented with behavior scenarios from the component test coverage.

Preview

Basic usage

authored

Import the component stylesheet and FloatButton from its package subpath, then render it with the core props.

Source
import "@duskmoon-dev/components/styles.css";
import { FloatButton } from "@duskmoon-dev/components/float-button";

export function Example() {
  return (<FloatButton type="primary" icon="+" tooltip="Create" />);
}
Preview

Renders icon, type, shape, description, tooltip, and badge

test-backed

FloatButton scenario from the component test coverage: renders icon, type, shape, description, tooltip, and badge.

Source
import "@duskmoon-dev/components/styles.css";
import { FloatButton } from "@duskmoon-dev/components/float-button";

export function FloatButtonRendersIconTypeShapeDemo() {
  return (<FloatButton type="primary" icon="+" tooltip="Create" />);
}
Preview

Supports links, disabled links, refs, and overflow badge count

test-backed

FloatButton scenario from the component test coverage: supports links, disabled links, refs, and overflow badge count.

Source
import "@duskmoon-dev/components/styles.css";
import { FloatButton } from "@duskmoon-dev/components/float-button";

export function FloatButtonSupportsLinksDisabledLinksDemo() {
  return (<FloatButton type="primary" icon="+" tooltip="Create" />);
}
Preview

Renders group with inherited shape and trigger state

test-backed

FloatButton scenario from the component test coverage: renders group with inherited shape and trigger state.

Source
import "@duskmoon-dev/components/styles.css";
import { FloatButton } from "@duskmoon-dev/components/float-button";

export function FloatButtonRendersGroupWithInheritedDemo() {
  return (<FloatButton type="primary" icon="+" tooltip="Create" />);
}
Preview

Back top becomes visible and scrolls target

test-backed

FloatButton scenario from the component test coverage: back top becomes visible and scrolls target.

Source
import "@duskmoon-dev/components/styles.css";
import { FloatButton } from "@duskmoon-dev/components/float-button";

export function FloatButtonBackTopBecomesVisibleDemo() {
  return (<FloatButton type="primary" icon="+" tooltip="Create" />);
}
Preview
Sunshine Theme
Moonlight Theme

Theme aware

authored

Docs previews inherit the DuskMoon data-theme value. Use the header switch to compare light and dark rendering.

Source
<div data-theme="sunshine">
  <FloatButton type="primary" icon="+" tooltip="Create" />
</div>

<div data-theme="moonlight">
  <FloatButton type="primary" icon="+" tooltip="Create" />
</div>

API

The API reference below lists every parsed exported type or interface for FloatButton. Start with `icon`, `type`, `shape`, `tooltip` for common usage.

Types: packages/components/src/components/float-button/FloatButton.types.tsScenarios: packages/components/src/components/float-button/FloatButton.test.tsx
FloatButtonPropsinterface extends Omit< ComponentPropsWithoutRef<"button">, "children" | "onClick" | "type" >
PropTypeRequiredDescription
iconReactNodeNoicon configures FloatButton.
typeFloatButtonTypeNotype configures FloatButton.
shapeFloatButtonShapeNoshape configures FloatButton.
tooltipFloatButtonTooltipNotooltip configures FloatButton.
descriptionReactNodeNodescription configures FloatButton.
badgeFloatButtonBadgeNobadge configures FloatButton.
hrefstringNohref configures FloatButton.
targetstringNotarget configures FloatButton.
childrenReactNodeNochildren configures FloatButton.
onClickMouseEventHandler<HTMLElement>NoonClick configures FloatButton.
FloatButtonTooltipConfiginterface
PropTypeRequiredDescription
titleReactNodeNotitle configures FloatButton.
placementFloatButtonTooltipPlacementNoplacement configures FloatButton.
FloatButtonBadgeinterface
PropTypeRequiredDescription
countReactNodeNocount configures FloatButton.
dotbooleanNodot configures FloatButton.
colorstringNocolor configures FloatButton.
overflowCountnumberNooverflowCount configures FloatButton.
FloatButtonGroupPropsinterface extends Omit< ComponentPropsWithoutRef<"div">, "onClick" >
PropTypeRequiredDescription
shapeFloatButtonShapeNoshape configures FloatButton.
triggerFloatButtonGroupTriggerNotrigger configures FloatButton.
openbooleanNoopen configures FloatButton.
closeIconReactNodeNocloseIcon configures FloatButton.
childrenReactNodeNochildren configures FloatButton.
onClickMouseEventHandler<HTMLElement>NoonClick configures FloatButton.
FloatButtonBackTopPropsinterface extends Omit< FloatButtonProps, "href" | "target" >
PropTypeRequiredDescription
visibilityHeightnumberNovisibilityHeight configures FloatButton.
target() => Window | HTMLElement | nullNotarget configures FloatButton.
FloatButtonTypetype
"default" | "primary"
FloatButtonShapetype
"circle" | "square"
FloatButtonGroupTriggertype
"click" | "hover"
FloatButtonTooltipPlacementtype
"top" | "bottom" | "left" | "right"
FloatButtonTooltiptype
ReactNode | FloatButtonTooltipConfig
FloatButtonComponenttype
ForwardRefExoticComponent< FloatButtonProps & RefAttributes<HTMLButtonElement | HTMLAnchorElement> > & { Group: ForwardRefExoticComponent< FloatButtonGroupProps & RefAttributes<HTMLDivElement> >