@impulse-ui-native/primitives
v2.0.1
Published
Token-aware React Native building blocks used directly by applications and by the higher-level Impulse UI Native packages.
Readme
@impulse-ui-native/primitives
Token-aware React Native building blocks used directly by applications and by the higher-level Impulse UI Native packages.
Installation
pnpm add @impulse-ui-native/primitivesRender primitives inside ThemeProvider from @impulse-ui-native/theme.
Main exports
Viewadds theme spacing, dimensions, flex, borders, colors, and shadow props to React Native's view.SafeAreaViewmaps safe-area edges to the theme spacing scale.Typographyexposes named text presets such asDisplayLarge,Title1,Body,Caption, andCode.Button,IconButton,Pressable, andTagprovide themed interaction primitives.Controlis a compound control system withProvider,Root,Label,Container,Addon,Input,Placeholder,Value,Loader, andErrorparts.createPresetcreates reusable themed typography presets.- Public prop types describe every primitive and control part.
Example
import { Button, Tag, Typography, View } from "@impulse-ui-native/primitives";
export function ProfileSummary() {
return (
<View gap="md" padding="lg">
<Typography.Title3>Profile</Typography.Title3>
<Tag label="Active" color="success" />
<Button variant="filled" onPress={() => {}}>
Continue
</Button>
</View>
);
}Use the compound Control when building a custom field that should share the same label, addon, error, size, and variant behavior as Input and Select.
