ExpoStartup

FloatingButton

A floating action button component for primary actions.

FloatingButton

A prominent floating action button for primary actions that can be positioned at the bottom of the screen.

Import

import FloatingButton from '@/components/FloatingButton';

Features

  • Fixed positioning at the bottom of the screen
  • Customizable icon and label
  • Navigation support via href
  • Animation options for visibility
  • Support for custom actions

Props

PropTypeDefaultDescription
iconIconNameIcon to display in the button
labelstringText label for the button
hrefstringNavigation destination
onPress() => voidCustom press handler
animatedbooleanfalseWhether to animate visibility
visiblebooleantrueControls visibility when animated
position'bottom-left' | 'bottom-right' | 'bottom-center''bottom-right'Button position on screen
classNamestringAdditional classes for styling

Basic Usage

// Simple floating button with icon
<FloatingButton 
  icon="Plus" 
  onPress={handleAddItem} 
/>
 
// With text label
<FloatingButton 
  icon="Plus" 
  label="New Item" 
  href="/items/new" 
/>
 
// Animated button that responds to scroll
<FloatingButton 
  icon="ArrowUp" 
  animated 
  visible={!isAtTop} 
  onPress={scrollToTop} 
/>

On this page