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 · ✓Desktop · n/aBetaLayout
Support level
Beta
Size
Not measured
Who uses it
No live product imports it yet
Screen — App shell, as React Native renders it

“App shell”, its React Native story at a phone's width — the same code on iOS and Android.

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

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

Why it is here. Used by Sovkora, Verikora, Folioviv.

When to use

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

When not to use

  • For a sheet over a screen.Use instead: Dialog

Installation

Install

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

Import

import { Screen } 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.

App shell

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

Screen — App shell, as React Native renders itScreen — App shell, as React Native renders it

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, as React Native renders itScreen — Dashboard, as React Native renders it

Sign in

The mark, two fields, the main action pinned.

Screen — Sign in, as React Native renders itScreen — Sign in, as React Native renders it

Profile

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

Screen — Profile, as React Native renders itScreen — Profile, as React Native renders it

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, as React Native renders itScreen — Feed, as React Native renders it

Chat

The person, the messages, the composer.

Screen — Chat, as React Native renders itScreen — Chat, as React Native renders it

Settings

Sections of switches that apply at once.

Screen — Settings, as React Native renders itScreen — Settings, as React Native renders it

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, as React Native renders itScreen — Settings home, as React Native renders it

Map

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

Screen — Map, as React Native renders itScreen — Map, as React Native renders it

Notifications

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

Screen — Notifications, as React Native renders itScreen — Notifications, as React Native renders it

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.

PropTypeDefaultDescription
childrenrequiredReactNode—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.

Accessibility

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

Best practices

  • 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.

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

On this page