Krizaka UI
Krizaka UI

Screen

A screen of the app — a header, the content (scrolling, rising with the keyboard, refreshing on a pull), a footer — and the templates built on it: app shell, dashboard, sign-in, profile, feed, chat, settings, a map, notifications.

Web · n/aMobile · ✓Bureau · n/aBêtaMise en page
Niveau de support
Bêta
Taille
Non mesurée
Qui l'utilise
Aucun produit en production ne l'importe encore
Screen — App shell, tel que React Native le rend

« App shell », son histoire React Native à la largeur d’un téléphone — le même code sur iOS et Android.

Mobile uniquement — React Native, depuis @krizaka/ui/native. Bêta : son API peut encore changer à une version mineure.

  • Web · n/a. A web screen's frame is the application shell. → App shell
  • Bureau · n/a. The Mac app's window is the application shell. → App shell

Pourquoi il est là. Used by Sovkora, Verikora, Folioviv.

Quand l’utiliser

  • Every screen of a React Native app.
  • The starting point of a new app: copy a template and fill it.

Quand ne pas l’utiliser

  • For a sheet over a screen.À la place : Dialog

Installation

Installer

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

Importer

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

Enveloppez l’application une fois dans ThemeProvider de @krizaka/ui/native : chaque composant lit ses rôles de couleur.

Exemples

React Native n’a pas d’aperçu en direct sur le web : chaque exemple montre la capture de sa story, testée dans les deux thèmes, et le code à copier.

App shell

A header, a section's content, the tab bar.

Screen — App shell, tel que React Native le rendScreen — App shell, tel que React Native le rend

Dashboard

A large title, a stat strip that is two per row on a phone and four on a tablet, the recent items, the tab bar; pull down to refresh.

Screen — Dashboard, tel que React Native le rendScreen — Dashboard, tel que React Native le rend

Sign in

The mark, two fields, the main action pinned.

Screen — Sign in, tel que React Native le rendScreen — Sign in, tel que React Native le rend

Profile

The photo and its ring, the facts, the interests.

Screen — Profile, tel que React Native le rendScreen — Profile, tel que React Native le rend

Feed

A vertical feed: one clip per screen, the action rail on the right, the caption bottom-left; the one in view plays.

Screen — Feed, tel que React Native le rendScreen — Feed, tel que React Native le rend

Chat

The person, the messages, the composer.

Screen — Chat, tel que React Native le rendScreen — Chat, tel que React Native le rend

Settings

Sections of switches that apply at once.

Screen — Settings, tel que React Native le rendScreen — Settings, tel que React Native le rend

Settings home

One list grouped by what it concerns: rows that open a screen, switches that apply at once, a danger zone.

Screen — Settings home, tel que React Native le rendScreen — Settings home, tel que React Native le rend

Map

The map fills the screen; a marker opens its place in a bottom sheet with the one action.

Screen — Map, tel que React Native le rendScreen — Map, tel que React Native le rend

Notifications

What happened, newest first and by day, with mark-all-as-read as a button.

Screen — Notifications, tel que React Native le rendScreen — Notifications, tel que React Native le rend

Props

A screen of the app: a header, the content (scrolling, rising with the keyboard), a footer — on the theme's surface, clear of the safe areas through its parts. The base of the templates: app shell, sign-in, profile, feed, chat, settings.

PropTypeDéfautDescription
childrenrequisReactNode—The content.
contentStyleStyleProp<ViewStyle>—Styles of the content.
footerReactNode—At the bottom: a TabBar, a MessageComposer, a main Button (they keep clear of the home indicator).
headerReactNode—At the top: a Header, a StepProgress (they keep clear of the status bar themselves).
keyboardbooleantrueThe content rises with the keyboard (a form, a chat). Default true.
onRefresh(() => void)—Pull to refresh: called when the person pulls the content down. Needs refreshing.
paddingnumber16Padding around the content. Default 16.
refreshingbooleanfalseWhether the data is refreshing; keep it true until the new data is there.
refreshLabelstring—The words of the pull (“Pull to refresh”), shown on iOS — passed translated.
scrollbooleantrueThe content scrolls (default) — or not, for a list that scrolls itself (List, FlatList).
surface"surface0" | "surface1"surface0The surface: surface0 (default) or surface1.
testIDstring—For tests: the scrolling content.

Accessibilité

  • The parts keep the safe areas; the content scrolls and is reachable by the keyboard on the web.

Bonnes pratiques

  • Put a Header (or a StepProgress) in header and a TabBar, a composer or a main button in footer.
  • scroll={false} when the content is a list that scrolls itself.
  • onRefresh and refreshing add the platform's pull to refresh to a scrolling screen; keep refreshing true until the new data is there.
  • Lay a stat strip or a gallery out with Grid, two panes with ListDetail: the columns follow the room, not the device.

Générée depuis le code de @krizaka/ui 5.3.4 : son meta.ts, ses exemples et ses types.Modifier cette documentation sur GitHub

Sur cette page