@carbon/react
Version:
React components for the Carbon Design System
34 lines (33 loc) • 1.23 kB
TypeScript
/**
* Copyright IBM Corp. 2016, 2025
*
* 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 { ReactNode } from 'react';
import { type GetTextDirection, type TextDir } from '.';
export interface TextDirectionProps {
children: ReactNode;
dir?: TextDir;
getTextDirection?: GetTextDirection;
}
export declare const TextDirection: {
({ children, dir, getTextDirection, }: TextDirectionProps): import("react/jsx-runtime").JSX.Element;
propTypes: {
/**
* Provide children to be rendered inside of this component
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
* Specify the text direction for rendered children
*/
dir: PropTypes.Requireable<string>;
/**
* Optionally provide a custom function to get the text direction for a piece
* of text. Whatever is returned will become the value of the `dir` attribute
* on a node of text. Should return one of: 'ltr', 'rtl', or 'auto'
*/
getTextDirection: PropTypes.Requireable<(...args: any[]) => any>;
};
};