Skip to content

Instantly share code, notes, and snippets.

@ishanjirety
Created July 24, 2022 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ishanjirety/6d54a71451fe7cb43fc942078cefe11f to your computer and use it in GitHub Desktop.
Save ishanjirety/6d54a71451fe7cb43fc942078cefe11f to your computer and use it in GitHub Desktop.
Prop types with design rules
type BoxTypes = {
childern?: React.ReactNode | JSX.Element | null;
// Disabled
disabled?: boolean;
// Margins
ml?: FourPixelGridSystem;
mt?: FourPixelGridSystem;
mr?: FourPixelGridSystem;
mb?: FourPixelGridSystem;
my?: FourPixelGridSystem;
mx?: FourPixelGridSystem;
// Padding
p?: FourPixelGridSystem;
pt?: FourPixelGridSystem;
pb?: FourPixelGridSystem;
pl?: FourPixelGridSystem;
pr?: FourPixelGridSystem;
py?: FourPixelGridSystem;
px?: FourPixelGridSystem;
// Size
width?: string;
height?: string;
maxWidth?: string;
minWidth?: string;
maxHeight?: string;
minHeight?: string;
// Display
display?: string;
// Border
border?: string;
borderWidth?: BorderWidth;
borderColor?: string;
borderStyle?: BorderStyle;
borderRadius?: BorderRadius;
borderTop?: string;
borderBottom?: string;
borderRight?: string;
borderLeft?: string;
// Position
position?: Position;
top?: string;
bottom?: string;
right?: string;
left?: string;
// Color
color?: string;
bg?: string;
backgroundImage?: string;
// Layout
flexWrap?: string;
flexDirection?: string;
flex?: string;
flexGrow?: string;
flexShrink?: string;
flexBasis?: string;
justifyContent?: ContentPosition;
justifySelf?: ItemsPosition;
justifyItems?: ItemsPosition;
alignContent?: ContentPosition;
alignSelf?: ItemsPosition;
alignItems?: ItemsPosition;
gridGap?: string;
gridColumn?: string | number;
gridRow?: string | number;
gridAutoFlow?: string;
gridAutoColumns?: string;
gridAutoRows?: string;
gridTemplateColumns?: string;
gridTemplateRows?: string;
gridTemplateAreas?: string;
gridRowGap?: FourPixelGridSystem | BreakPoints;
gridColumnGap?: number | string | BreakPoints;
// Typography
lineHeight?: string;
fontWeight?: FontWeights;
fontFamily?: FontFamily;
fontSize?: FontSize;
textAlign?: string;
// Shadow
boxShadow?: string;
// Utility
zIndex?: Zindex;
overflow?: Overflow | BreakPoints;
overflowX?: Overflow | BreakPoints;
overflowY?: Overflow | BreakPoints;
ref?: any;
opacity?: string;
visibility?: string;
cursor?: string;
// Others
shouldHover?: boolean;
//position
right?: string;
left?: string;
bottom?: string;
top?: string;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment