Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit c1bddbe

Browse files
committed
✨ feat: 新增 Center 组件
1 parent 363da8a commit c1bddbe

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

packages/layout-kit/src/Center.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { FlexboxProps } from './Flexbox';
2+
import { Flexbox } from './Flexbox';
3+
import type { FC } from 'react';
4+
5+
export type CenterProps = Omit<FlexboxProps, 'distribution' | 'direction' | 'align'>;
6+
7+
const Center: FC<CenterProps> = ({ children, ...res }) => {
8+
return <Flexbox {...res}>{children}</Flexbox>;
9+
};
10+
11+
export default Center;

packages/layout-kit/src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
export type { FlexboxProps, IFlexbox, CommonSpaceNumber } from './Flexbox';
22

33
export { Flexbox } from './Flexbox';
4+
export { default as Center } from './Center';
5+
export type { CenterProps } from './Center';

0 commit comments

Comments
 (0)