Krizaka
Documentation

Pull to refresh

The platform's pull to refresh in the theme's accent, for any ScrollView or FlatList.

MobileBetaFeedback

Mobile only — React Native, from @krizaka/ui/native. Beta: its API may still change in a minor version.

When to use

  • A ScrollView or a FlatList the app draws itself: a feed, a profile.

When not to use

  • In a List: its onRefresh draws it already.Use instead: List

Installation

Install

npx expo install react-native-svg
npm install @krizaka/ui

Import

import { PullToRefresh } from "@krizaka/ui/native";

Wrap the app once in ThemeProvider from @krizaka/ui/native: every component reads its colour roles.

Examples

React Native has no live preview on the web: each example shows the screenshot of its story, tested in both themes, and the code to copy.

A feed

The spinner at the top of a ScrollView, in the accent.

Pull to refresh — A feed, as React Native renders itPull to refresh — A feed, as React Native renders it

Props

The platform's pull to refresh in the theme's accent: the refreshControl of a ScrollView or a FlatList. List draws it already with onRefresh.

PropTypeDefaultDescription
labelstring—The words of the pull (“Pull to refresh”) — passed translated; shown on iOS under the spinner.

Accessibility

  • The platform's control: announced by the system while it refreshes.
  • Offer a refresh button too where pulling is hard (a short screen).

Best practices

  • Keep refreshing true until the new data is there.
  • Do not refresh on every focus: a pull is the person's choice.

Generated from the code of @krizaka/ui 3.5.0: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page