react-native-orchard
v0.2.1
Published
A modern, iOS-style UI component library for React Native applications.
Readme
react-native-orchard
A modern, iOS-style UI component library for React Native applications.
Installation
npm install react-native-orchard
# or
yarn add react-native-orchard
# or
bun add react-native-orchardFeatures
Components
List Components
ListContainer- Container for list-style contentRowContainer- Container for individual rowsRowContent- Content wrapper for row itemsRowLabel- Label component for rowsRowTrailing- Trailing content wrapper for rowsRowTextInput- Text input component for rowsRowSwitch- Switch component for rowsRowAccessoryIcon- Icon component for row accessoriesRowAccessoryLabel- Label component for row accessoriesRowTrailingMenu- Menu component for row trailing contentRowButton- Button component for rowsSwipeableRowContainer- Swipeable container for rows
Section Components
SectionContainer- Container for section contentSectionContent- Content wrapper for sections
Sheet Components
SheetHeaderContainer- Container for sheet headersSheetHeaderCloseButton- Close button for sheet headers
Basic Components
Button- Standard button componentTypography- Typography componentPressableOpacity- Pressable component with opacity feedbackHeaderButton- Button component for headers
Hooks
useTheme- Hook for accessing theme valuesuseRowTextInput- Hook for managing row text input stateuseRowSwitch- Hook for managing row switch stateuseTrailingMenu- Hook for managing trailing menu state
Theme
The package includes a comprehensive theme system with:
- Colors
- Spacing
- Typography
- Border Radius
- And more...
Usage
Basic Example
import {
ListContainer,
RowContainer,
RowLabel,
RowTextInput,
useRowTextInput,
} from "react-native-orchard";
function MyComponent() {
const textInputProps = useRowTextInput({
placeholder: "Enter text",
autoFocus: true,
});
return (
<ListContainer>
<RowContainer>
<RowLabel>Label</RowLabel>
<RowTextInput {...textInputProps} />
</RowContainer>
</ListContainer>
);
}Using Theme
import { useTheme } from "react-native-orchard";
function MyComponent() {
const { colors, spacing, typography } = useTheme();
return (
<View style={{ padding: spacing.md }}>
<Text style={{ color: colors.textPrimary }}>Hello World</Text>
</View>
);
}Sheet Example
import {
SheetHeaderContainer,
SheetHeaderCloseButton,
} from "react-native-orchard";
function MySheet() {
return (
<SheetHeaderContainer>
<SheetHeaderCloseButton />
{/* Sheet content */}
</SheetHeaderContainer>
);
}Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
