Skip to content

Add FloatingActionButton component#59

Merged
jalexw merged 3 commits into
mainfrom
claude/determined-feynman-QYQkR
May 24, 2026
Merged

Add FloatingActionButton component#59
jalexw merged 3 commits into
mainfrom
claude/determined-feynman-QYQkR

Conversation

@jalexw
Copy link
Copy Markdown
Contributor

@jalexw jalexw commented May 24, 2026

Summary

Introduces a new FloatingActionButton component to the UI library with comprehensive styling variants, sizes, and positioning options. The component supports both icon-only and extended (icon + label) layouts.

Changes

  • New Component: FloatingActionButton with the following features:

    • 5 variant options: primary, secondary, destructive, outline, brand
    • 3 size options: sm, default, lg
    • 5 position options: bottom-right, bottom-left, top-right, top-left, static
    • Automatic extended layout when a label prop is provided
    • Support for custom icons via the icon prop
    • Accessible with proper aria-label support
    • asChild prop for composing with Link components via Radix Slot
    • Smooth transitions and active state scaling (95%)
    • Shadow effects with variant-specific colors
  • Storybook Stories: Comprehensive story file with:

    • Default and extended examples
    • Individual variant showcases (Brand, Destructive, Outline)
    • Size variations (Small, Large)
    • Position examples (Bottom Left, Top Right)
    • Gallery stories showing all variants and sizes
    • Extended showcase with multiple icon examples
    • Pinned container example demonstrating fixed positioning
  • Exports: Updated src/components/ui/index.ts to export the new component and types

  • Version Bump: Updated package.json from 0.55.0 to 0.56.0

Implementation Details

  • Component uses class-variance-authority (cva) for variant management with compound variants for extended layout sizing
  • Built with Radix UI's Slot component for flexible composition
  • Includes proper TypeScript types for all variant IDs
  • Follows the library's component pattern with "use client" directive and explicit return types
  • Shadow styling uses variant-specific colors for visual consistency

https://claude.ai/code/session_012VroEKSgkYF7cKQu9g66cr

…itions, and extended-label mode

Introduces a new FloatingActionButton component (Material-style FAB) for
pinned primary actions. Supports five color variants (primary, secondary,
destructive, outline, brand), three sizes, four fixed positions plus a
static mode, and an extended layout when a label is provided. Includes a
Storybook story showcasing all variants, sizes, an extended showcase, and
a pinned-to-container example.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ui Ready Ready Preview, Comment May 24, 2026 12:17pm

Request Review

@jalexw jalexw self-assigned this May 24, 2026
…precated forwardRef

React 19 supports passing `ref` directly through component props, making
`forwardRef` unnecessary. Refactored FloatingActionButton to accept `ref`
as a prop and dropped the `forwardRef` wrapper, matching the pattern
already used elsewhere in the package (e.g. Banner).
…yground container

The interactive playground claimed the FAB was "rendered inside this
container" but the FAB uses position: fixed, so it actually anchored to
the Storybook viewport instead. Updated the playground wrapper to act as
a stand-in viewport: it now has overflow-hidden, and when a non-static
position is selected the FAB is overridden to position: absolute so it
pins to the demo box's corners. Reworded the description to accurately
explain the behavior (fixed in real apps, absolute here for visualization).
@jalexw jalexw merged commit 236b54f into main May 24, 2026
8 checks passed
@jalexw jalexw deleted the claude/determined-feynman-QYQkR branch May 24, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants