ConfigProvider
ConfigProvider (설정 공급자)
ConfigProvider는 애플리케이션의 가장 바깥쪽에서 설정해 주는 컴포넌트예요. 전역 파라미터를 여기서 한 번에 정할 수 있어서, 전체 앱의 공통 동작을 손쉽게 통일할 수 있습니다.
출처: 문서
본문
API
ConfigProvider
| 속성 | 설명 | 타입 | 기본값 | 버전 |
|---|---|---|---|---|
| autoInsertSpaceInButton | 버튼 안에 한글자씩(두 글자의) 중국어가 있을 때 두 글자 사이에 자동으로 공백을 넣어요. | boolean | - |
2.3.0 |
| effectGlobalModal | 모든 Modal 설정을 전역으로 적용할지 여부. |
boolean | true |
2.61.0 |
| effectGlobalNotice | 모든 Message와 Notification 설정을 한 번에 업데이트할지 여부. useMessage의 hook locale을 사용한다면 false로 설정해 주세요 |
boolean | true |
2.40.0 |
| rtl | 왼쪽에서 끝나고 오른쪽에서 시작하는 뷰(오른쪽에서 왼쪽으로 읽는 배치)를 사용해요. | boolean | - |
2.36.0 |
| prefixCls | 전역 ClassName 접두사 | string | arco |
- |
| size | 컴포넌트의 기본 크기를 설정해요. size 속성을 지원하는 컴포넌트에만 효과가 있어요. |
'mini' | 'small' | 'default' | 'large' | default |
- |
| loadingElement | 전역 로딩 아이콘. | ReactNode | - |
- |
| componentConfig | 모든 컴포넌트를 전역으로 설정할 때의 기본 파라미터 | ComponentConfig | - |
2.23.0 |
| focusLock | 전역 focusLock. Modal Drawer 컴포넌트에 영향을 줘요. |
{modal?: boolean | { autoFocus?: boolean };drawer?: boolean | { autoFocus?: boolean };} | { modal: { autoFocus: true }, drawer: { autoFocus: true }} |
2.13.0 |
| locale | 언어 패키지 설정 | Locale | - |
- |
| tablePagination | Table의 전역 페이지네이션 설정. | PaginationProps | - |
2.6.0 |
| theme | 테마 설정 | ThemeConfig | - |
- |
| getPopupContainer | 전역 팝업의 부모 노드. | (node: HTMLElement) => Element | () => document.body |
- |
| renderEmpty | 컴포넌트 안에서 쓰이는 빈(empty) 컴포넌트. | (componentName?: string) => ReactNode | - |
2.10.0 |
ComponentConfig
export type ComponentConfig = {
Affix?: AffixProps;
Alert?: AlertProps;
AutoComplete?: AutoCompleteProps;
Avatar?: AvatarProps;
"Avatar.Group"?: AvatarGroupProps;
Anchor?: AnchorProps;
"Anchor.Link"?: AnchorLinkProps;
BackTop?: BackTopProps;
Badge?: BadgeProps;
Breadcrumb?: BreadcrumbProps;
Button?: ButtonProps;
Calendar?: CalendarProps;
Card?: CardProps;
Carousel?: CarouselProps;
Cascader?: CascaderProps;
Checkbox?: CheckboxProps;
Collapse?: CollapseProps;
Comment?: CommentProps;
ColorPicker?: ColorPickerProps;
DatePicker?: Omit<
DatePickerCommonProps,
| "placeholder"
| "onChange"
| "onSelect"
| "onOk"
| "defaultPickerValue"
| "pickerValue"
| "onPickerValueChange"
| "inputProps"
>;
Descriptions?: DescriptionsProps;
Divider?: DividerProps;
Drawer?: DrawerProps;
Dropdown?: DropdownProps;
"Dropdown.Button"?: DropdownButtonProps;
Empty?: EmptyProps;
"Typography.Ellipsis"?: TypographyEllipsisProps;
Form?: FormProps;
"Grid.Row"?: RowProps;
"Grid.Col"?: ColProps;
Grid?: GridProps;
"Grid.GridItem"?: GridItemProps;
Image?: ImageProps;
Input?: InputProps;
InputNumber?: InputNumberProps;
VerificationCode?: VerificationCodeProps;
Watermark?: WatermarkProps;
InputTag?: InputTagProps;
Layout?: LayoutProps;
Link?: LinkProps;
List?: ListProps;
"List.Item"?: ListItemProps;
Mentions?: MentionsProps;
Menu?: MenuProps;
Modal?: ModalProps;
PageHeader?: PageHeaderProps;
Pagination?: PaginationProps;
Popconfirm?: PopconfirmProps;
Popover?: PopoverProps;
Progress?: ProgressProps;
Radio?: RadioProps;
"Radio.Group"?: RadioGroupProps;
Rate?: RateProps;
ResizeBox?: ResizeBoxProps;
Result?: ResultProps;
Select?: SelectProps;
Skeleton?: SkeletonProps;
Slider?: SliderProps;
Space?: SpaceProps;
Spin?: SpinProps;
Statistic?: StatisticProps;
Steps?: StepsProps;
Switch?: SwitchProps;
Table?: TableProps;
Tabs?: TabsProps;
TreeProps?: TreeProps;
TriggerProps?: TriggerProps;
Tag?: TagProps;
Timeline?: TimelineProps;
"Timeline.Item"?: TimelineItemProps;
TimePicker?: TimePickerCommonProps;
Tooltip?: TooltipProps;
Transfer?: TransferProps;
Tree?: TreeProps;
TreeSelect?: TreeSelectProps;
Trigger?: TriggerProps;
Upload?: UploadProps;
};
Locale
export interface Locale {
locale: string;
dayjsLocale?: string;
Calendar: CalendarType;
DatePicker: {
Calendar: CalendarType;
[key: string]: any;
};
Drawer: Record<string, any>;
Empty: Record<string, any>;
Modal: Record<string, any>;
Pagination: Record<string, any>;
Popconfirm: Record<string, any>;
Table: Record<string, any>;
TimePicker: Record<string, any>;
Upload: Record<string, any>;
Progress: Record<string, any>;
Typography: Record<string, any>;
Transfer: Record<string, any>;
ImagePreview: Record<string, any>;
Form?: Record<string, any>;
ColorPicker: Record<string, any>;
}
CalendarType
type CalendarType = {
today: string;
view: Record<string, any>;
month: {
short: Record<string, any>;
long: Record<string, any>;
};
week: {
short: Record<string, any>;
long: Record<string, any>;
};
formatYear?: string;
formatMonth?: string;
monthBeforeYear?: boolean;
};
ThemeConfig
export type ThemeConfig = Record<string, any>;
더 알아보기
ConfigProvider 컴포넌트의 더 자세한 내용은 Arco Design 공식 문서에서 확인해 보세요.