1.0.0 • Published 4 years ago

parachut-components v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

parachut-components

NPM JavaScript Style Guide

Install

npm install --save parachut-components

Circle Button

Example

<CircleButton text="Become a member"/>

Props

OptionDescriptionTypeDefault
classNameCSS Class nameString
onClickonClick actionFunction
styleInline styleObject
textButton text (required)String

 

Column

Example

<Col>
  <div>...</div>
</Col>

Props

OptionDescriptionTypeDefault
alignalign-items propertyStringstretch
classNameCSS Class nameString
contentalign-content propertyStringstretch
justifyjustify-content propertyStringflex-start
onClickonClick actionFunction
selfalign-self propertyStringauto
styleInline styleObject
wrapflex-wrap propertyStringno-wrap

 

Container

Example

<Container>
  <div>...</div>
</Container>

Props

OptionDescriptionTypeDefault
classNameCSS Class nameString
modalCloseModal close on click outsideFunction
modalOverlayColorModal overlay colorStringrgba(0, 0, 0, .5)
modalVisibleModal overlay visibilityBooleanfalse
styleInline styleObject
widthcontainer widthNumber1140

 

Grid System

Example

<Grid>
  <Col xs={12} md={6}>
    <div>...</div>
  </Col>
  <Col xs={12} md={3}>
    <div>...</div>
  </Col>
  <Col xs={12} md={6}>
    <div>...</div>
  </Col>
</Grid>

Grid Props

OptionDescriptionTypeDefault
alignalign-items propertyStringstretch
classNameCSS Class nameString
contentalign-content propertyStringstretch
directionflex-direction propertyStringrow
justifyjustify-content propertyStringflex-start
selfalign-self propertyStringauto
styleInline styleObject
wrapflex-wrap propertyStringno-wrap

 

Column/Row Child Props

OptionDescriptionTypeDefault
lglg column width1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
mdmd column width1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
smsm column width1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
xlxl column width1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
xsxs column width1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12

 

Breakpoints

SizeRange
xs< 600px
sm600px-959px
md960px-1279px
lg1280px-1919px
xl> 1920px

 

Hidden

Example

<Hidden smDown>
  <div>...</div>
</Hidden>

Props

OptionDescriptionTypeDefault
xsDownxs and down hiddenBoolean
xsUpxs and up hiddenBoolean
smDownsm and down hiddenBoolean
smUpsm and up hiddenBoolean
mdDownmd and down hiddenBoolean
mdUpmd and up hiddenBoolean
lgDownlg and down hiddenBoolean
lgUplg and up hiddenBoolean
xlDownxl and down hiddenBoolean
xlUpxl and up hiddenBoolean

 

Input

Example (Text)

<Input
  error={errors.firstName}
  id="firstName"
  onBlur={onBlur}
  onChange={onChange}
  placeholder="First Name"
  touched={touched.firstName}
  value={values.phone}
/>

Example (Number)

<Input
  error={errors.phone}
  id="phone"
  format="###-###-####"
  mask="_"
  onBlur={onBlur}
  onChange={onChange}
  placeholder="Phone number"
  touched={touched.phone}
  value={values.phone}
/>

Props

OptionDescriptionTypeDefault
classNameCSS Class nameString
error¹Error messageString
format²Number input formatString
idInput field idString
mask²Number input maskString
maxLengthInput value max lengthNumber
onBlurAction on blurFunction
onChangeAction on text changeFunction
placeholderPlaceholder textString
styleInline styleObject
touched¹Field has been in focusBoolean
typeInput type"number", "text"text
valueInput field valueString
¹Formik ²react-number-format

 

Modal

Example

<Container overlay={isOpen}>
  <div>....</div>
  <Modal isOpen={isOpen}>
    <div>...</div>
  </Modal>
</Container>

Props

OptionDescriptionTypeDefault
classNameCSS Class nameString
closeColorClose icon colorblack/whitewhite
isOpenVisible state of modalBooleanfalse
onCloseAction on closeFunction
styleInline styleObject
Container props modalClose, modalOverlayColor, modalVisible work in tandem with Modal

 

Navbar

Example

<Navbar>
  <div>...</div>
</Navbar>

Props

OptionDescriptionTypeDefault
borderBottom border colorString
classNameCSS Class nameString
colorBackground colorString
inContainerNavbar in containerBoolean
containerWidthWidth of containerNumber1140
styleInline styleObject

 

Nested Button

Example

<NestedButton text="Sign up" size="small"/>

Props

OptionDescriptionTypeDefault
classNameCSS Class nameString
onClickonClick actionFunction
sizeButton size"small", "medium", "large"medium
styleInline styleObject
textButton text (required)String

 

Row

Example

<Row>
  <div>...</div>
</Row>

Props

OptionDescriptionTypeDefault
alignalign-items propertyStringstretch
classNameCSS Class nameString
contentalign-content propertyStringstretch
justifyjustify-content propertyStringflex-start
onClickonClick actionFunction
selfalign-self propertyStringauto
styleInline styleObject
wrapflex-wrap propertyStringno-wrap

 

Text

Example

<Text size='h1'>h1</Text>
<Text size='h2'>h2</Text>
<Text size='h3'>h3</Text>
<Text size='h4'>h4</Text>
<Text size='h5'>h5</Text>
<Text size='h6'>h6</Text>
<Text size='subtitle'>subtitle</Text>
<Text size='body'>body</Text>
<Text size='caption'>caption</Text>

Props

OptionDescriptionTypeDefault
classNameCSS Class nameString
colorText colorStringblack
fontStyleFont style"italic", "normal"normal
onClickonClick actionFunction
sizeFont size"h1","h2", "h3", "h4", "h5", "h6", "subtitle", "body", "caption"body
styleInline styleObject
weightFont weigh"bold", "medium", "normal"normal

 

Font Sizes

KeySize
h172px
h248px
h336px
h424px
h521px
h616px
subtitle12px
body10px
caption8px
1.0.0

4 years ago