ApplicationProvider
ApplicationProvider is the root component of a UI Kitten application. It provides Eva Design System styles, theme variables, and icon packs to all descendant components. Every UI Kitten app must wrap its root component tree with ApplicationProvider.
Import
import { ApplicationProvider } from '@ui-kitten/components';
Basic Usage
import React from 'react';
import * as eva from '@ui-kitten/eva';
import { ApplicationProvider, Layout, Text } from '@ui-kitten/components';
const App = () => (
<ApplicationProvider {...eva} theme={eva.light}>
<Layout style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text category="h1">Welcome to UI Kitten</Text>
</Layout>
</ApplicationProvider>
);
export default App;
Props
| Property | Type | Default | Description |
|---|---|---|---|
mapping | SchemaType | - | Eva mapping configuration object. Required unless styles is given. |
theme | ThemeType | - | Eva theme object (e.g., eva.light or eva.dark). |
customMapping | CustomSchemaType | undefined | Custom mapping overrides for component styles. |
styles | ThemeStyleType | - | Pre-processed styles, used instead of mapping and customMapping. |
children | ReactNode | - | The application component tree. |
ApplicationProvider accepts the mapping in one of two shapes, and exactly one of them is required:
mapping(plus optionalcustomMapping) — the mapping is processed at runtime, on every app start.styles— an already-processed style object, produced at build time by@ui-kitten/metro-config. Faster to start, and what you should use in production.
Storybook
Live examples coming soon via Storybook.