UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

47 lines (46 loc) 1.99 kB
import { BoxProps, ElementProps, Factory, MantineSize, MantineSpacing, StylesApiProps } from '../../core'; import { ListItem, ListItemStylesNames } from './ListItem/ListItem'; export type ListStylesNames = 'root' | ListItemStylesNames; export type ListCssVariables = { root: '--list-fz' | '--list-lh' | '--list-spacing'; }; export interface ListProps extends BoxProps, StylesApiProps<ListFactory>, ElementProps<'ol', 'type'> { /** `List.Item` components */ children?: React.ReactNode; /** List type @default 'unordered' */ type?: 'ordered' | 'unordered'; /** Adds extra horizontal padding to the list, useful for nested lists @default false */ withPadding?: boolean; /** Controls `font-size` and `line-height` @default 'md' */ size?: MantineSize; /** Icon to replace default list markers. Applied to all items unless overridden on individual List.Item components */ icon?: React.ReactNode; /** Key of `theme.spacing` or any valid CSS value to set spacing between items @default 0 */ spacing?: MantineSpacing; /** Vertically centers list items with their icons @default false */ center?: boolean; /** Controls CSS `list-style-type` property. Overrides the default list marker style based on list type */ listStyleType?: React.CSSProperties['listStyleType']; /** Starting value for ordered list numbering (only works with type="ordered") */ start?: number; /** Reverses the order of list items (only works with type="ordered") */ reversed?: boolean; } export type ListFactory = Factory<{ props: ListProps; ref: HTMLUListElement; stylesNames: ListStylesNames; vars: ListCssVariables; staticComponents: { Item: typeof ListItem; }; }>; export declare const List: import("../..").MantineComponent<{ props: ListProps; ref: HTMLUListElement; stylesNames: ListStylesNames; vars: ListCssVariables; staticComponents: { Item: typeof ListItem; }; }>;