1.2.9 • Published 5 years ago

@cohubinc/blueprint v1.2.9

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

Blueprint

Blueprint is a small set of typed React components for quickly laying out groups of elements.

Installation

npm install @cohubinc/blueprint

yarn add @cohubinc/blueprint

Components

Stack

Use Stack to vertically position elements.

<Stack space={2}>
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</Stack>

Props

children: ReactNode[] | ReactNode;
space?: number;
alignment?: "center" | "left" | "right";
fullWidth?: boolean;
childrenWidth?: CSSProperties["width"];
style?: CSSProperties;
PropDescriptionRequiredDefault
childrenany valid ReactNode or array of ReactNodestrueN/A
spacerem based bottom margin applied to all child elementsfalse1
alignmenthorizontal alignment of the entire <Stack>false"left"
fullWidthcauses <Stack> to take 100% of the available horizontal spacefalsefalse
childrenWidthset the width of any children inside of <Stack> to any valid width value according to React's CSSProperties typefalsenull
styleany additional style properties needed for Stackfalsenull

Inline

Use Inline to horizontally position elements.

<Inline space={2}>
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</Inline>

Props

children: ReactNode[] | ReactNode;
space?: number;
alignment?: "center" | "left" | "right";
itemAlignment?: "start" | "end" | "center" | "baseline" | "stretch";
style?: CSSProperties;
PropDescriptionRequiredDefault
childrenany valid ReactNode or array of ReactNodestrueN/A
spacerem based right or left margin (depending on what's specified for the alignment prop)false1
alignmenthorizontal alignment of the entire <Inline>false"left"
itemAlignmentused to vertically align children of <Inline>false"left"
styleany additional style properties needed for Stackfalsenull

Spread

Use Spread to spread elements out either horizontally or vertically. Think of Spread as a normal CSS flexbox.

Props

children: ReactElement<any> | ReactElement<any>[];
direction?: "horizontal" | "vertical";
spread?: "between" | "around" | "evenly" | "start" | "end" | "center";
itemAlignment?: "start" | "end" | "center" | "baseline" | "stretch";
flexChild?: boolean;
style?: CSSProperties;
PropDescriptionRequiredDefault
childrenany valid ReactElement or array of ReactElementstrueN/A
directionthe orientation of the <Spread>false"horizontal"
spreadflexbox spacing rule AKA justify-contentfalse"between"
itemAlignmentused to vertically align children of <Spread>false"start"
flexChildused for vertical Spreads to allow children to take up all vertical heightfalsetrue
styleany additional style properties needed for Stackfalsenull

Space

Use Space to insert whitespace between elements.

Props

height?: CSSProperties["height"];
width?: CSSProperties["width"];
unit?: | "cm" | "mm" | "in" | "px" | "pt" | "pc" | "em" | "rem" | "ex" | "ch" | "vw" | "vh" | "vmin" | "vmax" | "%";
PropDescriptionRequiredDefault
heightthe height of the <Space>false"inherit"
widththe width of the <Space>false"inherit"
unitthe unit value for height and widthfalse"rem"
revealshow the space by setting its background color to black (really only useful during development)falsefalse
1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago