@berlitz/floating-action-button

FloatingActionButton component for the Max Design System

Usage no npm install needed!

<script type="module">
  import berlitzFloatingActionButton from 'https://cdn.skypack.dev/@berlitz/floating-action-button';
</script>

README

Floating Action Button npm version

Add a floating action button to your site, handles any custom onclick event when pressed.

Installation

yarn add @berlitz/floating-action-button

Props

Argument Type Required Default Example
as string "button" accepts 'a', 'button'
href string
to string
onClick function () => alert('click')
text string
isHidden bool false

Usage

import FloatingActionButton from '@berlitz/floating-action-button'
const MyApp = () => (
  <FloatingActionButton onClick={() => alert('click')} text="Example Button" />
)

When to use this component

  • Scroll to top
  • Scroll to call to action
  • Redirect to forms