New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

grapefruit-ui

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grapefruit-ui

simple, lightweight, and configurable library with layout components

latest
Source
npmnpm
Version
0.4.1
Version published
Maintainers
1
Created
Source

Grapefruit-ui

Version npm size License: MIT CI

simple, lightweight, and configurable library with layout components

Install

npm install grapefruit-ui

Usage

First, you need to import styles to use the default grid (base 12 columns) and spacing (base 0.5rem) systems.

import 'grapefruit-ui/dist/styles.css';

Otherwise, please add css variables, eg:

:root {
  --grid-columns: 12;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-xxl: 2.5rem;
}

Example

import { Column, Container, Flex, Row } from 'grapefruit-ui';

import 'grapefruit-ui/dist/styles.css';

function App() {
  return (
    <div className="App">
      <Container style={{ border: '5px solid red' }}>
        <Flex justify="space-between">
          <div style={{ padding: 20, background: 'black' }} />
          <div style={{ padding: 20, background: 'black' }} />
          <div style={{ padding: 20, background: 'black' }} />
        </Flex>
        <Row>
          <Column sm={6} xl={4}><div  style={{ border: '2px solid green', padding: 20 }}/></Column>
          <Column sm={6} md={4} lg={6} xl={4}><div  style={{ border: '2px solid green', padding: 20 }}/></Column>
        </Row>
      </Container>
    </div>
  );
}

export default App;

API

All components are nothing but a wrap over div element, so they accept all its props.

Flex

PropertyTypeDefault value
display`flexinline-flex`
directionCSSProperties.FlexDirection-
wrapCSSProperties.FlexWrap-
justifyCSSProperties.JustifyContent-
justifySelfCSSProperties.JustifySelf-
justifyItemsCSSProperties.JustifyItems-
alignCSSProperties.AlignItems-
alignSelfCSSProperties.AlignItems-
alignContentCSSProperties.AlignContent-
orderCSSProperties.Order-
growCSSProperties.FlexGrow-
shrinkCSSProperties.FlexShrink-
basisCSSProperties.FlexBasis-
flexCSSProperties.Flex-

Row

PropertyTypeDefault value
wrapCSSProperties.FlexWrapwrap
directionCSSProperties.FlexDirection-

Column

By default, all columns have the same width.

PropertyBreakpointTypeDefault value
xs< 576pxnumber-
sm< 768pxnumber-
md< 1024pxnumber-
lg< 1280pxnumber-
xl< 1366pxnumber-
xxl>= 1366pxnumber-

The value, provided for the biggest breakpoint (eg. md) will be used for the remaining (eg. lg, xl, xxl).

Container

PropertyDescriptionTypeDefault value
fullwidthRemoves max-widthBooleanfalse

The max-width will be set respectively:

Breapoint< 576px< 768px< 1024px< 1280px< 1366px
max-width520px690px920px1152px1230px

Keywords

react

FAQs

Package last updated on 17 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts