libreact icon indicating copy to clipboard operation
libreact copied to clipboard

NO LONGER MAINTAINED - SEE https://github.com/streamich/libreact INSTEAD

libreact logo

libreact

React Universal Interface

React standard library — must-have toolbox for any React project.

  • Isomorphic - all components work in browser and on server (and some in react-native).
  • See demos, docs, and package.

Installation

npm i libreact --save

Usage

Import each utility individually to decrease your bundle size

import {mock} from 'libreact/lib/mock';

const MyComponent = mock();

Contents

  • Introduction
  • Dummies
    • mock() and loadable()example
    • lazy() and delayed()
  • Inversion
    • <State> and withState()
      • <Toggle>, withToggle(), and @withToggleexample
      • <Flipflop>, withFlipflop(), and @withFlipflop
      • <Value>, withValue(), and @withValue
      • <Counter>, withCounter() and @withCounter
      • <List>, withList(), and @withList
      • <Map>, withMap(), and @withMap
    • <ShouldUpdate>, shouldUpdate(), and pure()
    • <Lifecycles>
    • invert() and <Inverted>
  • Sensors
    • <ActiveSensor>, withActive(), and @withActive
    • <BatterySensor>, withBattery(), and @withBattery
    • <ExitSensor>example
    • <FocusSensor>, withFocus(), and @withFocus
    • <GeoLocationSensor>, withGeoLocation(), and @withGeoLocation
    • <HoverSensor>, withHover(), and @withHoverexample
    • <IdleSensor>, withIdle(), and @withIdle
    • <MediaDeviceSensor>, withMediaDevices(), and @withMediaDevices
    • <MediaSensor>, withMedia(), and @withMedia
    • <MotionSensor>, withMotion(), and @withMotion
    • <MouseSensor>, withMouse(), and @withMouseexample
    • <NetworkSensor>, withNetwork(), and @withNetwork
    • <LightSensor>, withLight(), and @withLight
    • <LocationSensor>, withLocation(), and @withLocation
    • <OrientationSensor>, withOrientation(), and @withOrientation
    • <ScratchSensor>, withScratch(), and @withScratch
    • <ScrollSensor>
    • <SizeSensor>, withSize(), and @withSizeexample
      • <WidthSensor>, withWidth(), and @withWidth
    • <ViewportSensor>, withViewport(), and @withViewport
      • <ViewportScrollSensor> and <ViewportObserverSensor>
    • <WindowScrollSensor>, withWindowScroll(), and @withWindowScroll
    • <WindowSizeSensor>, withWindowSize(), and @withWindowSize
      • <WindowWidthSensor>, withWindowWidth(), and @withWindowWidth
  • Context
    • <Provider>, <Consumer>, withContext(), and @withContext
    • <Theme>, <Themed>, withTheme(), and @withTheme
    • <CssVarsProvider>, <CssVars>, withCssVars(), and @withCssVars
    • Router
    • <Translations>, <Translate>, <T>, withT(), and @withT
  • UI
    • <Portal>, <Overlay>, and <Modal>
    • <Dimmer> and <Dimmable>
    • <Parallax>
    • <FullScreen>
    • <Slider>
    • <DropArea>
    • <Group>
    • <OutsideClick>
    • <Ripple> and withRipple()example
    • <Img>
    • <WidthQuery>, <View>, <WindowWidthQuery>, and <InlineWidthQuery>
    • <Audio> and <Video>
    • <Speak>, <Vibrate>, <Alert>
  • Animation
    • <AfterTimeout>, <AfterDraf>, and <WhenIdle>
    • <Render>, withRender(), and @withRender
    • <RenderInterval>, withRenderInterval(), and @withRenderInterval
    • <Tween>, withTween(), and @withTween
    • <Interpolation>, withInterpolation(), and @withInterpolation
  • Side Effects
    • <LocalStorage>
    • <ClassNames>
    • go(), <Sms>, <Mailto>
  • Boundaries
    • <BrowserOnly>, <ServerOnly>, and <ElectronOnly>
    • <ErrorBoundary> and withErrorBoundary()
    • <CacheBoundary>
  • NEXT
    • createRef(), createState(), and createLifecycleEvents()
  • Other
    • <Resolve>
    • getDisplayName()

License

Unlicense — public domain.