@fluentui/react-northstar
Version:
A themable React component library.
52 lines (51 loc) • 2.5 kB
TypeScript
import { Accessibility } from '@fluentui/accessibility';
import * as PropTypes from 'prop-types';
import * as React from 'react';
import { UIComponentProps, ChildrenComponentProps, ContentComponentProps, ColorComponentProps } from '../../utils';
import { ImageProps } from '../Image/Image';
import { BoxProps } from '../Box/Box';
import { ShorthandValue, FluentComponentStaticProps } from '../../types';
export interface LabelProps extends UIComponentProps, ChildrenComponentProps, ContentComponentProps<ShorthandValue<BoxProps>>, ColorComponentProps {
/**
* Accessibility behavior if overridden by the user.
*/
accessibility?: Accessibility<never>;
/** A Label can be circular. */
circular?: boolean;
/** A Label can take up the width of its container. */
fluid?: boolean;
/** A Label can have an icon. */
icon?: ShorthandValue<BoxProps>;
/** A Label can position its Icon at the start or end of the layout. */
iconPosition?: 'start' | 'end';
/** A Label can contain an image. */
image?: ShorthandValue<ImageProps>;
/** A Label can position its image at the start or end of the layout. */
imagePosition?: 'start' | 'end';
}
export declare type LabelStylesProps = Pick<LabelProps, 'circular' | 'color' | 'imagePosition' | 'iconPosition'> & {
hasImage: boolean;
hasIcon: boolean;
hasActionableIcon: boolean;
};
export declare const labelClassName = "ui-label";
/**
* A Label allows user to classify content.
*/
export declare const Label: (<TExtendedElementType extends React.ElementType<any> = "span">(props: React.RefAttributes<HTMLSpanElement> & Omit<import("@fluentui/react-bindings").PropsOfElement<TExtendedElementType>, "as" | keyof LabelProps> & {
as?: TExtendedElementType;
} & LabelProps) => JSX.Element) & {
propTypes?: React.WeakValidationMap<LabelProps> & {
as: React.Requireable<string | ((props: any, context?: any) => any) | (new (props: any, context?: any) => any)>;
};
contextTypes?: PropTypes.ValidationMap<any>;
defaultProps?: Partial<LabelProps & {
as: "span";
}>;
displayName?: string;
readonly __PRIVATE_PROPS?: React.RefAttributes<HTMLSpanElement> & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
ref?: React.Ref<HTMLSpanElement>;
}, "as" | keyof LabelProps> & {
as?: "span";
} & LabelProps;
} & FluentComponentStaticProps<{}>;