0.1.7 ā€¢ Published 5 years ago

cidro v0.1.7

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

CIDRO UI - React Native UI Library šŸ”„

npm

Install

šŸ“šDocumentation

$ npm install cidro

Available Components

Block

Usage

import { Block, Text } from "cidro";

const App = () => (
  <Block safe>
    <Text h1>CIDRO šŸ”„</Text>
  </Block>
);

Available Props

PropertyTypeDefaultDescription
rowboolfalseflexDirection: 'row'
columnboolfalseflexDirection: 'column'
flexbool, numberfalse, 1flex: 1 or
safeboolfalseWrap the block with SafeAreaView
centerboolfalsealignItems: 'center' alignSelf: 'center'
middleboolfalsealignItems: 'center' alignSelf: 'center'
topboolfalsealignItems: 'flex-start' alignSelf: 'flex-start'
bottomboolfalsealignItems: 'flex-end' alignSelf: 'flex-end'
leftboolfalsealignItems: 'flex-start'
rightboolfalsealignItems: 'flex-start'
cardboolfalsechanges the border-radius, -width and -color
fluidboolfalsewidth: 'auto'
heightnumbernullchanges the height of the Block
spacestringnulloptions are: 'between', 'around' or 'evently'
widthnumbernullchanges the width of the Block

Toolbar

Usage

import { Toolbar, Text } from "cidro";

const App = () => (
    <Toolbar
      left={<Text>Back</Text>}
      leftHandler={() => alert("left handler")}
      center={<Text>CIDRO UI šŸ”„</Text>}
      right={<Text>Logout</Text>}
      rightHandler={() => alert("right handler")}
);

Available Props

PropertyTypeDefaultDescription
colorstringnullchange color
noShadowbooleanfalseToolbar without shadow
heightnumber52change height
leftcomponentnullset your own component (eg: Text or Icon)
leftHandlerfunction() => {}Take an arrow function and everytime the user presses the function is called.
centercomponentnullset your own component
rightcomponentnullset your own component
rightHandlerfunction() => {}Take an arrow function and everytime the user presses the function is called.
stylestylenulladd any style to the whole container

Button

Usage

import { Button } from "cidro";

const App = () => <Button text="Login" onPress={action("Button pressed")} />;

Available Props

PropertyTypeDefaultDescription
textstringnullTitle is required
disabledboolfalseChange the disabled button
loadingboolfalseShow loading indicator
sizenumber10Change the size button
widthstringnullChange the width
outlineboolfalseChange button style
typestringprimaryAvailable type "primary", "success", "danger", "warning"

Text

Usage

import { Text } from "cidro";

const App = () => <Text h1>CIDRO UI šŸ”„</Text>;

Available Props

PropertyTypeDefaultDescription
h1boolfalseSets the text's fontSize to 44px.
h2boolfalseSets the text's fontSize to 38px.
h3boolfalseSets the text's fontSize to 30px.
h4boolfalseSets the text's fontSize to 24px.
h5boolfalseSets the text's fontSize to 18px.
pboolfalseSets the text's fontSize to 16px.
sizenumber0Sets the fontSize of the text.
colorstringnullSets the color of the text.
mutedboolfalseChanges the text color
boldboolfalseSets the fontWeight to 'bold'.
italicboolfalseSets the fontStyle to 'italic'.

Form

Usage

import { Form } from "cidro";

const App = () => (
  <Form title="Helo šŸ”„" subtitle="Cidro is awesome because built with ā¤ļø">
    <View style={{ flex: 1, backgroundColor: "papayawhip" }} />
  </Form>
);

Available Props

PropertyTypeDefaultDescription
childrencomponentnullset your own component
titlebool, stringfalse, nullset your title
subtitlebool, stringfalse, nullset your subtitle

Input

Usage

import { TextInput } from "cidro";

const App = () => (
  <TextInput
    label="Email"
    value="cidro@ui.good"
    keyboardType="email-address"
    onChangeText={() => alert("Text On Change")}
  />
);

Available Props

PropertyTypeDefaultDescription
labelstringnullset your label
messagestringnullset your message (eg: "Whops your email is invalid")
typestringnullAvailable type "success", "error"

Avatar

Usage

import { Avatar } from "cidro";

const App = () => (
  <Avatar source={{ uri: "https://facebook.github.io/react/logo-og.png" }} />
);

Available Props

PropertyTypeDefaultDescription
sizenumber60set size
sourceanynullset image source, can be static from your app or external
circlebooleanfalseset border radius / 2 if set true
stylestylenulladd any style to the whole container

Avatar Text

Usage

import { AvatarText } from "cidro";

const App = () => <AvatarText title="Cidro UI" />;

Available Props

PropertyTypeDefaultDescription
titlestringnullset title for initials
sizenumber60set size
backgroundColorstringblackset background color
textColorstringwhiteset text title color
circlebooleanfalseset border radius / 2 if set true
stylestylenulladd any style to the whole container

Support

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago