UNPKG

@nex-ui/react

Version:

🎉 A beautiful, modern, and reliable React component library.

57 lines (54 loc) • 1.7 kB
import { ElementType, ReactNode } from 'react'; import { ClassValue } from 'clsx'; import { Interpolation, CSSObject } from '@nex-ui/system'; import { OverrideProps } from '../../types/utils.js'; interface FlexPropsOverrides { } type FlexOwnProps<RootComponent extends ElementType> = { /** * The component or element to render as the root. * * @default 'div' */ as?: RootComponent; /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx?: Interpolation; /** * The content of the flex. */ children?: ReactNode; /** * Additional class names to apply to the root. */ className?: ClassValue; /** * Set the alignment of elements in the direction of the main axis. */ justify?: CSSObject['justifyContent']; /** * Set the alignment of elements in the direction of the cross axis. */ align?: CSSObject['alignItems']; /** * Set how flex items are placed in the flex container that defines the main axis and the direction. * @default 'row' */ direction?: CSSObject['flexDirection']; /** * Set whether the element is displayed in a single line or in multiple lines. */ wrap?: CSSObject['flexWrap']; /** * Set the gap between flex items. */ gap?: CSSObject['gap']; /** * If true, the flex container is displayed as an inline flex container. * @default false */ inline?: boolean; }; type FlexProps<RootComponent extends ElementType = 'div'> = OverrideProps<RootComponent, FlexOwnProps<RootComponent>, FlexPropsOverrides>; export type { FlexProps, FlexPropsOverrides };