feat: init props

This commit is contained in:
snowingfox 2024-05-10 18:32:53 +08:00
parent c9f7f5d8e6
commit 5f219d97e0
2 changed files with 13 additions and 0 deletions

View File

@ -20,9 +20,14 @@ const Flex = React.forwardRef<HTMLElement, FlexProps>((props, ref) => {
children,
vertical = false,
component: Component = 'div',
columns,
spacing,
sequential = false,
...othersProps
} = props;
console.log(columns, spacing, sequential);
const {
flex: ctxFlex,
direction: ctxDirection,

View File

@ -14,4 +14,12 @@ export interface FlexProps<P = AnyObject> extends React.HTMLAttributes<HTMLEleme
gap?: React.CSSProperties['gap'] | SizeType;
children: React.ReactNode;
component?: CustomComponent<P>;
columns?: number;
spacing?: number;
/**
* Allows using sequential order rather than adding to shortest column
*
* @default false
*/
sequential?: boolean;
}