@carbon/react
Version:
React components for the Carbon Design System
45 lines (44 loc) • 1.54 kB
TypeScript
/**
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import PropTypes from 'prop-types';
import { ElementType, ReactNode } from 'react';
import { LayoutDirectionContext } from './LayoutDirectionContext';
type Direction = 'ltr' | 'rtl';
export interface LayoutDirectionProps {
/**
* Customize the element type used to render the outermost node
*/
as?: ElementType;
/**
* Provide child elements or components to be rendered inside of this
* component
*/
children?: ReactNode;
/**
* Specify the layout direction of this part of the page
*/
dir: Direction;
}
declare function LayoutDirection({ as: BaseComponent, children, dir, ...rest }: LayoutDirectionProps): import("react/jsx-runtime").JSX.Element;
declare namespace LayoutDirection {
var propTypes: {
/**
* Customize the element type used to render the outermost node
*/
as: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.ReactComponentLike | null | undefined>>;
/**
* Provide child elements or components to be rendered inside of this
* component
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
* Specify the layout direction of this part of the page
*/
dir: PropTypes.Validator<string>;
};
}
export { LayoutDirectionContext, LayoutDirection };