1.1.0 • Published 8 months ago

react-fluent-mobile v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Banner

NPM Storybook Gitter Roadmap

Maintainability Quality Assurance

What's the problem with mobile browsers?

Mobile web browsers are an adaptation of the PC browsing experience for your mobile device. As a result, many features found on desktop browsers are sloppily implemented in ways that just aren't meant for phones, degrading your browsing experience.

Introducing fluency!

react-fluent-mobile allows you to take your mobile browser's native features and augment them, improving gloss and agility without compromising on ability.

Selecting text

Fluent takes selecting text on mobile to a whole new level by adding the selection manipulation pad. When text is selected by the user, whether selected through normal means, selected by the website, or tap-selected on Android, the selection manipulation pad appears. Users can touch and drag on the pad to shift the bounds of their selection in any direction they'd like, transforming their selection. Once the selection is fit to the user's liking, they can tap on the pad to instantly copy their selection to their clipboard.

  • One finger shifts the end bound
  • If a second finger is present, the first continues shifting the end while the second shifts the beginning, allowing manipulation of both bounds at the same time
  • Double-tapping on the pad copies the contents of the selection to the clipboard

    NOTE: Copying to clipboard utilizes Clipboard API and therefore requires HTTPS. (document.execCommand() will also be attempted for HTTP)

  • Swiping down on the pad dismisses the pad and selection

Component Properties

NameDescription
collapseSwipeDistanceThe minimum distance required to swipe down to dismiss the selection
collapseSwipeDurationThe maximum duration of the swipe down to dismiss the selection
nativeManipulationInactivityDurationThe interval the manipulation pad is inactive for when the selection is natively manipulated
themeThe theme of the pad (dark, light)

Context menus

Context menus have been reimagined! Now, instead of holding and lifting your finger four times, holding down on a link or image will launch a cleaner context menu in which you can drag you finger to the desired option and lift your finger to select it. No more tapping!

If the new context menu is not desired, there is an option located at the bottom corner of the screen to disable it.

NOTE: Opening in new tab may trigger browser popup blockers NOTE: The share features are only available on HTTPS sites NOTE: Copying images to clipboard utilizes Clipboard API and therefore requires HTTPS.

Component Properties

NameDescription
themeThe theme of the pad (dark, light)

Media control

INSERT GIF

Coming soon

Installation and Quickstart

npm i react-fluent-mobile

import {
  FluentContextMixin,
  FluentSelectionMixin
} from 'react-fluent-mobile'

function Component (props) {
  return (
    <>
      <FluentContextMixin />
      <FluentSelectionMixin />

      <div ...>
        ...
      </div>
    </>
  )
}

Snappy, fluid, deliberate interactions

INSERT GIF


Known bugs

  • Tapping on the manipulation pad on Safari makes the selection invisible (this is an unavoidable quirk with Safari)

Developer notes

  • The share feature in the custom context menu doesn't work if the server is not HTTPS
  • Fluent Mobile works on all browsers and platforms
  • Safari does not allow haptics
  • The custom FlexibleRange class used for the selection system is exposed in the exports. Feel free to use it
  • Try to keep the mixins at the root of the heirarchy
  • You do not need to check for mobile devices before mounting the component. FM does that for you.