Skip to content

Latest commit

 

History

History
267 lines (167 loc) · 7.43 KB

README.md

File metadata and controls

267 lines (167 loc) · 7.43 KB

reflexion

reflexion

Table of contents

Type Aliases

Functions

Type Aliases

Alignment

Ƭ Alignment: "top-left" | "top" | "top-right" | "left" | "center" | "right" | "bottom-left" | "bottom" | "bottom-right"

Defined in

types.ts:5


Dimension

Ƭ Dimension: "hug" | "fill" | string | number

Defined in

types.ts:16


Direction

Ƭ Direction: "vertical" | "horizontal"

Defined in

types.ts:3


FlexProps

Ƭ FlexProps<E>: Object

Type parameters

Name Type
E extends HTMLElement = HTMLDivElement

Type declaration

Name Type Description
Component? JSX.ElementType Container component to use to render. Default ts "div"
align? Alignment Element container setting that sets the alignment of its children. If set, the element is considered to be a container.
class? string Element classes.
className? string -
direction? Direction Element container setting that sets the flow direction of the children. If set, the element is considered to be a container.
gap? Gap Element container setting that set the gap betwen its children. If set to "auto", the gap is evenly distributed between the children.
height? Dimension Element height. If set to "fill", the element vertically fills the parent container. If set to "hug", it hugs the content of its children.
maxHeight? Dimension Element maximum height. If set to "fill", the element vertically fills the parent container. If set to "hug", it hugs the content of its children.
maxWidth? Dimension Element maximum width. If set to "fill", the element horizontally fills the parent container. If set to "hug", it hugs the content of its children.
minHeight? Dimension Element minimum height. If set to "fill", the element vertically fills the parent container. If set to "hug", it hugs the content of its children.
minWidth? Dimension Element minimum width. If set to "fill", the element horizontally fills the parent container. If set to "hug", it hugs the content of its children.
noShrink? true Explicitly prevent the element from shrinking if set to true.
overflow? "hidden" | "auto" Element overflow setting. Controlled by the scroll property.
ref? Ref<E> -
scroll? boolean Element container setting that enables scrolling if its content goes out of bounds.
style? JSX.AllCSSProperties Element styles. These override any style abstracted by the other properties.
width? Dimension Element width. If set to "fill", the element horizontally fills the parent container. If set to "hug", it hugs the content of its children.
wrap? boolean Element container setting that sets whether containing items should wrap or not.

Defined in

types.ts:22


FlexableComponent

Ƭ FlexableComponent: keyof JSX.IntrinsicElements & string

Defined in

types.ts:20


Gap

Ƭ Gap: "auto" | number | string

Defined in

types.ts:18

Functions

Flex

Flex<E>(«destructured», ref?): Element

Creates a div element with abstracted CSS Flexbox properties.

Type parameters

Name Type
E extends HTMLElement = HTMLDivElement

Parameters

Name Type
«destructured» FlexProps<E> & Omit<HTMLAttributes<E>, keyof FlexProps>
ref? Ref<E>

Returns

Element

Defined in

components/Flex.tsx:12


adjustGap

adjustGap(style, gap): null | object

Parameters

Name Type
style null | object
gap undefined | Gap

Returns

null | object

Defined in

tools/adjustGap.ts:3


alignFlex

alignFlex(align, direction): Object

Parameters

Name Type
align Alignment
direction Direction

Returns

Object

Name Type
alignItems string
justifyContent string

Defined in

tools/alignFlex.ts:3


flex

flex(direction, wrap, align, overflow, gap, width?, minWidth?, maxWidth?, height?, minHeight?, maxHeight?, noShrink?): JSX.CSSProperties

Parameters

Name Type
direction undefined | Direction
wrap boolean
align undefined | Alignment
overflow undefined | "auto" | "hidden"
gap undefined | Gap
width? Dimension
minWidth? Dimension
maxWidth? Dimension
height? Dimension
minHeight? Dimension
maxHeight? Dimension
noShrink? true

Returns

JSX.CSSProperties

Defined in

tools/flex.ts:9


flexDirection

flexDirection(direction): "row" | "column"

Parameters

Name Type
direction Direction

Returns

"row" | "column"

Defined in

tools/flexDirection.ts:3


merge

merge<A, B>(a, b?): A | A & B

Type parameters

Name Type
A extends object
B extends object

Parameters

Name Type
a A
b? B

Returns

A | A & B

Defined in

tools/merge.ts:1