React Native UI component library
npm install @selfxyz/euclidA production-ready React Native component library built with TypeScript.
``bash`
npm install @selfxyz/euclidor
yarn add @selfxyz/euclid
This library requires the following peer dependencies:
`json`
{
"react": ">=18.2.0",
"react-native": ">=0.72.0"
}
`tsx
import { Button, Card } from '@selfxyz/euclid';
const App = () => {
return (
title="Click Me"
onPress={() => console.log('Pressed')}
variant="primary"
size="medium"
/>
);
};
`
A versatile button component with multiple variants and sizes.
Props:
- title (string, required) - Button textonPress
- (function, required) - Press handlervariant
- ('primary' | 'secondary' | 'outline') - Visual variantsize
- ('small' | 'medium' | 'large') - Button sizedisabled
- (boolean) - Disabled statefullWidth
- (boolean) - Full width button
A container component for grouping related content.
Props:
- children (ReactNode, required) - Card contentvariant
- ('elevated' | 'outlined' | 'filled') - Visual variantpadding
- (SpacingKey) - Internal padding
Access design tokens:
`tsx
import { colors, spacing, typography, borderRadius } from '@selfxyz/euclid';
const styles = StyleSheet.create({
container: {
backgroundColor: colors.primary,
padding: spacing.md,
borderRadius: borderRadius.lg,
},
text: {
fontSize: typography.fontSize.md,
fontWeight: typography.fontWeight.semibold,
},
});
``
This library is written in TypeScript and includes type definitions.
We aim to have zero dependencies. First to keep the package light and second to reduce complications.
Where a certain library is needed for a UI/visiaul reason (bluring, svg) add it as a peer dependency and then as a dependency on main app. This prevents React Native "tried to register two views with same name" errors.
Business Source License 1.1
See LICENSE.MD