UNPKG

@mskcc/carbon-react

Version:

Carbon react components for the MSKCC DSM

32 lines (31 loc) 1.24 kB
/** * MSKCC DSM 2021, 2023 */ import React from 'react'; /** * The Stack component is a useful layout utility in a component-based model. * This allows components to not use margin and instead delegate the * responsibility of positioning and layout to parent components. * * In the case of the Stack component, it uses the spacing scale from the * Design Language in order to determine how much space there should be between * items rendered by the Stack component. It also supports a custom `gap` prop * which will allow a user to provide a custom value for the gap of the layout. * * This component supports both horizontal and vertical orientations. * * Inspiration for this component: * * - https://paste.twilio.design/layout/stack/ * - https://github.com/Workday/canvas-kit/blob/f2f599654876700f483a1d8c5de82a41315c76f1/modules/labs-react/layout/lib/Stack.tsx */ export interface StackProps { as?: React.ElementType; children?: React.ReactNode; className?: string; gap?: string | number; orientation?: 'horizontal' | 'vertical'; [key: string]: any; } declare const Stack: React.ForwardRefExoticComponent<Pick<StackProps, keyof StackProps> & React.RefAttributes<unknown>>; export { Stack };