For AI agents: the complete documentation index is available at https://ifhover.github.io/leaf-ui/v/0.6.0/llms.txt, the full documentation bundle is available at https://ifhover.github.io/leaf-ui/v/0.6.0/llms-full.txt, and this page is available as Markdown at https://ifhover.github.io/leaf-ui/v/0.6.0/api/component-defaults.md.
  • 简体中文
  • 组件默认参数

    通过 ConfigProvider 的 components 设置区域内的组件默认参数。常用示例、命名规则和继承方式见组件默认值。

    LeafComponentDefaults

    所有配置项均可选。每项接受下表列出的参数,或用 null 清除继承;点击类型可查看参数含义及组件内置默认值。必填项、模式关联值、泛型数据和命令式引用仍由实例提供。

    属性类型说明
    AffixPartial<Omit<AffixProps, 'key' | 'ref'>> | null设置 Affix。
    AlertPartial<Omit<AlertProps, 'key' | 'ref' | 'title'>> | null设置 Alert。
    AnchorPartial<Omit<AnchorProps, 'key' | 'ref' | 'items'>> | null设置 Anchor。
    AppBarPartial<Omit<AppBarProps, 'key' | 'ref'>> | null设置 AppBar。
    AutoCompletePartial<Omit<AutoCompleteProps, 'key' | 'ref' | 'options'>> | null设置 AutoComplete。
    AvatarPartial<Omit<AvatarProps, 'key' | 'ref'>> | null设置 Avatar。
    AvatarGroupPartial<Omit<AvatarGroupProps, 'key' | 'ref'>> | null设置 AvatarGroup。
    BackTopPartial<Omit<BackTopProps, 'key' | 'ref'>> | null设置 BackTop。
    BadgePartial<Omit<BadgeProps, 'key' | 'ref'>> | null设置 Badge。
    BottomNavigationPartial<Omit<BottomNavigationProps, 'key' | 'ref' | 'items'>> | null设置 BottomNavigation。
    BreadcrumbPartial<Omit<BreadcrumbProps, 'key' | 'ref' | 'items'>> | null设置 Breadcrumb。
    ButtonPartial<Omit<ButtonProps, 'key' | 'ref'>> | null按钮的默认参数。
    ButtonGroupPartial<Omit<ButtonGroupProps, 'key' | 'ref'>> | null设置 ButtonGroup。
    CalendarPartial<Omit<CalendarProps, 'key' | 'ref'>> | null设置 Calendar。
    CardPartial<Omit<CardProps, 'key' | 'ref'>> | null设置 Card。
    CarouselPartial<Omit<CarouselProps, 'key' | 'ref'>> | null设置 Carousel。
    CascaderPartial< Omit< CascaderProps, 'key' | 'ref' | 'options' | 'multiple' | 'value' | 'defaultValue' | 'onChange' > > | null设置 Cascader。
    CheckableTagPartial<Omit<CheckableTagProps, 'key' | 'ref'>> | null设置 CheckableTag。
    CheckboxPartial<Omit<CheckboxProps, 'key' | 'ref'>> | null设置 Checkbox。
    CheckboxGroupPartial<Omit<CheckboxGroupProps, 'key' | 'ref' | 'options'>> | null设置 CheckboxGroup。
    ColPartial<Omit<ColProps, 'key' | 'ref'>> | null设置 Col。
    CollapsePartial<Omit<CollapseProps, 'key' | 'ref' | 'items'>> | null设置 Collapse。
    ColorPickerPartial<Omit<ColorPickerProps, 'key' | 'ref'>> | null设置 ColorPicker。
    CommandPalettePartial<Omit<CommandPaletteProps, 'key' | 'ref' | 'items'>> | null设置 CommandPalette。
    ConfirmPartial<Omit<ConfirmOptions, 'key' | 'ref'>> | null设置 Confirm。
    CountdownPartial<Omit<CountdownProps, 'key' | 'ref' | 'value'>> | null设置 Countdown。
    DataTablePartial<Omit<DataTablePresentationProps, 'tableRef'>> | null设置 DataTable。
    DataTableColumnVisibilityPartial<Omit<DataTableColumnVisibilityProps, 'key' | 'ref'>> | null设置 DataTableColumnVisibility。
    DataTableContentPartial<Omit<DataTableContentProps, 'key' | 'ref'>> | null设置 DataTableContent。
    DataTableFooterPartial<Omit<HTMLAttributes<HTMLDivElement>, 'key' | 'ref'>> | null设置 DataTableFooter。
    DataTablePaginationPartial<Omit<DataTablePaginationProps, 'key' | 'ref'>> | null设置 DataTablePagination。
    DataTableSearchPartial<Omit<DataTableSearchProps, 'key' | 'ref'>> | null设置 DataTableSearch。
    DataTableToolbarPartial<Omit<HTMLAttributes<HTMLDivElement>, 'key' | 'ref'>> | null设置 DataTableToolbar。
    DatePickerPartial< Omit<DatePickerProps, 'key' | 'ref' | 'multiple' | 'value' | 'defaultValue' | 'onChange'> > | null设置 DatePicker。
    DateRangePickerPartial<Omit<DateRangePickerProps, 'key' | 'ref'>> | null设置 DateRangePicker。
    DateTimePickerPartial<Omit<DateTimePickerProps, 'key' | 'ref'>> | null设置 DateTimePicker。
    DescriptionsPartial<Omit<DescriptionsProps, 'key' | 'ref' | 'items'>> | null设置 Descriptions。
    DividerPartial<Omit<DividerProps, 'key' | 'ref'>> | null设置 Divider。
    DrawerPartial<Omit<DrawerProps, 'key' | 'ref' | 'open'>> | null设置 Drawer。
    DropdownPartial<Omit<DropdownProps, 'key' | 'ref' | 'items' | 'children'>> | null设置 Dropdown。
    EmptyPartial<Omit<EmptyProps, 'key' | 'ref'>> | null设置 Empty。
    ErrorBoundaryPartial<Omit<ErrorBoundaryProps, 'key' | 'ref'>> | null设置 ErrorBoundary。
    FileListPartial<Omit<FileListProps, 'key' | 'ref' | 'items'>> | null设置 FileList。
    FlexPartial<Omit<FlexProps, 'key' | 'ref'>> | null设置 Flex。
    FloatButtonPartial<Omit<FloatButtonProps, 'key' | 'ref'>> | null设置 FloatButton。
    FloatButtonGroupPartial<Omit<FloatButtonGroupProps, 'key' | 'ref' | 'actions'>> | null设置 FloatButtonGroup。
    FormPartial<Omit<FormProps, 'key' | 'ref'>> | null设置 Form。
    FormErrorSummaryPartial<Omit<FormErrorSummaryProps, 'key' | 'ref'>> | null设置 FormErrorSummary。
    FormFieldPartial<Omit<FormFieldProps, 'key' | 'ref'>> | null设置 FormField。
    FormGroupPartial<Omit<FormGroupProps, 'key' | 'ref'>> | null设置 FormGroup。
    FormListPartial< Omit< FormListProps<unknown>, 'name' | 'children' | 'value' | 'defaultValue' | 'onChange' | 'itemKey' > > | null设置 FormList。
    GridPartial<Omit<GridProps, 'key' | 'ref'>> | null设置 Grid。
    ImagePartial<Omit<ImageProps, 'key' | 'ref'>> | null设置 Image。
    ImagePreviewPartial< Omit<ImagePreviewProps, 'key' | 'ref' | 'items' | 'open' | 'onClose'> > | null设置 ImagePreview。
    ImagePreviewGroupPartial<Omit<ImagePreviewGroupProps, 'key' | 'ref'>> | null设置 ImagePreviewGroup。
    InfiniteScrollPartial< Omit<InfiniteScrollProps, 'key' | 'ref' | 'dataLength' | 'hasMore' | 'onLoadMore'> > | null设置 InfiniteScroll。
    InputPartial<Omit<InputProps, 'key' | 'ref'>> | null输入框的默认参数,InputSearch 也继承这些输入参数。
    InputGroupPartial<Omit<InputGroupProps, 'key' | 'ref'>> | null设置 InputGroup。
    InputMaskPartial<Omit<InputMaskProps, 'key' | 'ref' | 'mask'>> | null设置 InputMask。
    InputNumberPartial< Omit< InputNumberProps, 'key' | 'ref' | 'stringMode' | 'value' | 'defaultValue' | 'onChange' | 'min' | 'max' | 'step' > > | null设置 InputNumber。
    InputOTPPartial<Omit<InputOTPProps, 'key' | 'ref'>> | null设置 InputOTP。
    InputSearchPartial<Omit<InputSearchProps, 'key' | 'ref'>> | null搜索框默认参数,优先于 Input 配置。
    LayoutPartial<Omit<LayoutProps, 'key' | 'ref'>> | null设置 Layout。
    LayoutContentPartial<Omit<HTMLAttributes<HTMLElement>, 'key' | 'ref'>> | null设置 LayoutContent。
    LayoutFooterPartial<Omit<HTMLAttributes<HTMLElement>, 'key' | 'ref'>> | null设置 LayoutFooter。
    LayoutHeaderPartial<Omit<HTMLAttributes<HTMLElement>, 'key' | 'ref'>> | null设置 LayoutHeader。
    LayoutSiderPartial<Omit<LayoutSiderProps, 'key' | 'ref'>> | null设置 LayoutSider。
    LinkPartial<Omit<LinkProps, 'key' | 'ref'>> | null设置 Link。
    LoadingPartial<Omit<LoadingProps, 'key' | 'ref'>> | null设置 Loading。
    LoadingBarPartial<Omit<LoadingBarProps, 'key' | 'ref' | 'active' | 'progress'>> | null设置 LoadingBar。
    MasonryPartial<Omit<MasonryProps, 'key' | 'ref'>> | null设置 Masonry。
    MentionsPartial<Omit<MentionsProps, 'key' | 'ref' | 'options'>> | null设置 Mentions。
    MenuPartial<Omit<MenuProps, 'key' | 'ref' | 'items'>> | null设置 Menu。
    MessagePartial<Omit<MessageOptions, 'key' | 'content'>> | null设置 Message。
    ModalPartial<Omit<ModalProps, 'key' | 'ref' | 'open'>> | null弹窗默认参数。
    NotificationPartial<Omit<NotificationOptions, 'key' | 'title'>> | null设置 Notification。
    PaginationPartial<Omit<PaginationProps, 'key' | 'ref' | 'total'>> | null设置 Pagination。
    ParagraphPartial<Omit<ParagraphProps, 'key' | 'ref'>> | null设置 Paragraph。
    PopconfirmPartial<Omit<PopconfirmProps, 'key' | 'ref' | 'children' | 'title'>> | null设置 Popconfirm。
    PopoverPartial<Omit<PopoverProps, 'key' | 'ref' | 'children' | 'content'>> | null设置 Popover。
    ProgressPartial<Omit<ProgressProps, 'key' | 'ref'>> | null设置 Progress。
    QRCodePartial<Omit<QRCodeProps, 'key' | 'ref' | 'value'>> | null设置 QRCode。
    RadioPartial<Omit<RadioProps, 'key' | 'ref'>> | null设置 Radio。
    RadioGroupPartial<Omit<RadioGroupProps, 'key' | 'ref' | 'options'>> | null设置 RadioGroup。
    RatePartial<Omit<RateProps, 'key' | 'ref'>> | null设置 Rate。
    ResultPartial<Omit<ResultProps, 'key' | 'ref'>> | null设置 Result。
    RowPartial<Omit<RowProps, 'key' | 'ref'>> | null设置 Row。
    ScrollAreaPartial<Omit<ScrollAreaProps, 'key' | 'ref'>> | null设置 ScrollArea。
    ScrollbarPartial<Omit<ScrollbarProps, 'key' | 'ref'>> | null设置 Scrollbar。
    SegmentedPartial<Omit<SegmentedProps, 'key' | 'ref' | 'options'>> | null设置 Segmented。
    SelectPartial< Omit< SelectProps, 'key' | 'ref' | 'options' | 'multiple' | 'value' | 'defaultValue' | 'onChange' > > | null选择器默认参数;模式、值与变更回调仍由实例设置。
    SkeletonPartial<Omit<SkeletonProps, 'key' | 'ref'>> | null设置 Skeleton。
    SliderPartial< Omit<SliderProps, 'key' | 'ref' | 'range' | 'value' | 'defaultValue' | 'onChange'> > | null设置 Slider。
    SpacePartial<Omit<SpaceProps, 'key' | 'ref'>> | null设置 Space。
    SplitButtonPartial<Omit<SplitButtonProps, 'key' | 'ref' | 'items'>> | null设置 SplitButton。
    SplitterPartial<Omit<SplitterProps, 'key' | 'ref' | 'panels'>> | null设置 Splitter。
    StatisticPartial<Omit<StatisticProps, 'key' | 'ref' | 'value'>> | null设置 Statistic。
    StepsPartial<Omit<StepsProps, 'key' | 'ref' | 'items'>> | null设置 Steps。
    SwitchPartial<Omit<SwitchProps, 'key' | 'ref'>> | null设置 Switch。
    TablePartial<Omit<TableProps, 'key' | 'ref' | 'scrollRef'>> | null设置 Table。
    TableBodyPartial<Omit<HTMLAttributes<HTMLTableSectionElement>, 'key' | 'ref'>> | null设置 TableBody。
    TableCaptionPartial<Omit<HTMLAttributes<HTMLTableCaptionElement>, 'key' | 'ref'>> | null设置 TableCaption。
    TableCellPartial<Omit<TableCellProps, 'key' | 'ref'>> | null设置 TableCell。
    TableColumnHeaderPartial<Omit<TableColumnHeaderProps, 'key' | 'ref'>> | null设置 TableColumnHeader。
    TableEmptyPartial<Omit<TableStateProps, 'key' | 'ref'>> | null设置 TableEmpty。
    TableErrorPartial<Omit<TableErrorProps, 'key' | 'ref'>> | null设置 TableError。
    TableFooterPartial<Omit<HTMLAttributes<HTMLTableSectionElement>, 'key' | 'ref'>> | null设置 TableFooter。
    TableHeaderPartial<Omit<HTMLAttributes<HTMLTableSectionElement>, 'key' | 'ref'>> | null设置 TableHeader。
    TableLoadingPartial<Omit<TableStateProps, 'key' | 'ref'>> | null设置 TableLoading。
    TableRowPartial<Omit<TableRowProps, 'key' | 'ref'>> | null设置 TableRow。
    TabsPartial<Omit<TabsProps, 'key' | 'ref' | 'items'>> | null设置 Tabs。
    TagPartial<Omit<TagProps, 'key' | 'ref'>> | null设置 Tag。
    TagGroupPartial<Omit<TagGroupProps, 'key' | 'ref' | 'options'>> | null设置 TagGroup。
    TextPartial<Omit<TextProps, 'key' | 'ref'>> | null设置 Text。
    TextareaPartial<Omit<TextareaProps, 'key' | 'ref'>> | null设置 Textarea。
    TimelinePartial<Omit<TimelineProps, 'key' | 'ref' | 'items'>> | null设置 Timeline。
    TimePickerPartial<Omit<TimePickerProps, 'key' | 'ref'>> | null设置 TimePicker。
    TimeRangePickerPartial<Omit<TimeRangePickerProps, 'key' | 'ref'>> | null设置 TimeRangePicker。
    TitlePartial<Omit<TitleProps, 'key' | 'ref'>> | null设置 Title。
    ToolbarPartial<Omit<ToolbarProps, 'key' | 'ref'>> | null设置 Toolbar。
    TooltipPartial<Omit<TooltipProps, 'key' | 'ref' | 'content' | 'children'>> | null设置 Tooltip。
    TourPartial<Omit<TourProps, 'key' | 'ref' | 'open' | 'steps'>> | null设置 Tour。
    TransferPartial<Omit<TransferProps, 'key' | 'ref' | 'items'>> | null设置 Transfer。
    TreePartial<Omit<TreeProps, 'key' | 'ref' | 'data'>> | null设置 Tree。
    TreeSelectPartial< Omit< TreeSelectProps, | 'key' | 'ref' | 'options' | 'multiple' | 'treeCheckable' | 'value' | 'defaultValue' | 'onChange' > > | null设置 TreeSelect。
    TypographyPartial<Omit<TypographyProps, 'key' | 'ref'>> | null设置 Typography。
    UploadPartial<Omit<UploadProps, 'key' | 'ref'>> | null设置 Upload。
    VirtualList(Partial< Omit<VirtualListProps<unknown>, 'items' | 'itemKey' | 'renderItem' | 'estimateSize'> > & { estimateSize?: number }) | null设置 VirtualList。

    类型导入

    import type { LeafComponentDefaults } from '@ifhover/leaf-ui';
    
    const components = {
      Button: { variant: 'outline' },
      Confirm: { confirmText: '继续', cancelText: '返回' },
    } satisfies LeafComponentDefaults;

    将该对象传给 <ConfigProvider components={components}>。实例参数和服务的单次调用参数仍优先于区域默认值。