Note this captures the floating button only, not floating tools and dialogs (see T280330).
A prominent button that floats on top of the UI
Add at least one user story.
Multiple products have introduced a floating button in their UI, making this a candidate for evaluation to add to the DSG/as a Codex component via the DST governance model. Coming out of the work on the help panel (see T206717) was a need for a floating action button that:
- Is anchored to a fixed position
- Appears in front of *all content* on the screen.
- Appears more prominently and clearly seen as "above" all other content
|Outdated Example:||Current example as of Nov 2022||Example in different states|
Known use cases
|Growth - Help panel button||Growth - Structured task button next to help||Web - Vector 2022 toggle width button||WMDE - Help button within a Process dialog||Keyboard input toggle menu on each field||CX proposal to switch from a toggle on each field to a single floating button (not in production)|
- GrowthExperiments Newcomer help panel open/close button and structured task button
- Vector 2022 content width toggler
Wikimedia Design Style Guide links:
- n/a, not included in the DSG
Component task owners
- Designer: add the main designer's name
- Developer: add the main developer's name
- Are there any limits on which icons can be used? Should there be default icons for expand/collapse, for example?
- Can we use the FloatingUI library, which is currently used in Codex for sizing and placement of dropdown menus?
Once a component spec sheet has been created in Figma, remove the note stating that the spec is missing and link to the spec below.
A component spec sheet has not been created yet.
|Component spec sheet|
Designer should list the structure and properties of the component.
Designer should list the visual features of the component.
Designer should list interaction specifications.
Designer should describe how the component should be documented, including configurable and standalone demos.
Minimum viable product (MVP)
This task covers the minimum viable product (MVP) version of this component. MVP includes basic layout, default states, and most important functionality.
- MVP only covers the FloatingButton itself. In the future, the FloatingButton component may be used inside a new FloatingTools component, which displays a floating panel when a FloatingButton is pressed
- Structure and style of the FloatingButton. This includes a way to include a single icon, or an icon for each state (on/off)
- Styles for all potential states of the FloatingButton. States should make sense for FloatingButtons that show/hide a floating tool, or that simply indicate one state vs. another (e.g. the width toggle)
- Proper z-index token set on the FloatingButton to ensure it will float above even Dialogs
- State can be toggled by the user or set in the parent component (possibly use v-model)
- A single position (bottom right)
- Design the Figma spec sheet and add a link to it in this task
- Update the component in the Figma library. This step will be done by a DST member.
- Implement the component in Codex
- (Potential) Other positioning options
- Guidelines on how to use FloatingButtons. These are critical for 2 use cases:
- An app that adds 2 or more FloatingButtons that should display side by side. Guidelines may cover placement and recommended max number of buttons.
- Multiple apps adding FloatingButtons that could potentially overlap (e.g. the GrowthExperiments help panel and the width toggle). Guidelines may cover when it's acceptable to use a FloatingButton, how to deal with potential overlap, and alternate recommendations if a FloatingButton is not the right choice