Skip to content

Provider API Reference

Provider component is used to wrap your app content and provide the theme context.

PropTypeDefaultDescription
childrenReactNode-App content wrapped by the provider
defaultTheme?ThemeMode'system'Sets the initial theme mode. 'system' follows device preference
customDarkThemePartial<Theme>undefinedCustom theme configuration for dark mode
customLightThemePartial<Theme>undefinedCustom theme configuration for light mode
bottomSheetPropsBottomSheetProps{}Global props for bottom sheet components
toastToastConfig{}Configuration for toast notifications
i18nConfigI18nConfigundefinedInternationalization configuration
PropertyTypeRequiredDefaultDescription
defaultSnapTostringNoundefinedDefault snap position for the bottom sheet
maxSnapTostringNoundefinedMaximum snap position for the bottom sheet
backgroundColorViewStyle['backgroundColor']NoundefinedBackground color of the bottom sheet
backDropColorstringNoundefinedColor of the backdrop overlay
lineBackgroundColorViewStyle['backgroundColor']NoundefinedColor of the drag indicator line
borderTopLeftRadiusViewStyle['borderTopLeftRadius']NoundefinedTop left border radius
borderTopRightRadiusViewStyle['borderTopRightRadius']NoundefinedTop right border radius
isBorderBottomTitleVisiblebooleanfalseWhether to show border below title
onStateChange(state: boolean) => voidundefinedCallback when bottom sheet state changes
variant'scroll' | 'flatlist''scroll'Type of scrollable content in bottom sheet
flatListPropsOmit<FlatListProps<T>, 'ref'>undefinedProps for FlatList when variant is ‘flatlist’
PropertyTypeDefaultDescription
position'top' or 'bottom''bottom'Position of the toast notifications
maxToastsnumber5Maximum number of toast notifications to show at once
PropertyTypeRequiredDefaultDescription
translationsRecord<string, any>NoundefinedAn object containing translation key-value pairs for different languages. The keys represent translation identifiers, and values can be strings, objects, or any other type containing the translated content.
supportedLocalesstring[]NoundefinedAn array of locale codes (e.g., ['en', 'id', 'fr']) that the application supports. These should follow standard locale format (ISO 639-1 language codes).
defaultLocalestringNoundefinedThe default locale code to use when no specific locale is selected or when the requested locale is not supported. Should be one of the locales listed in supportedLocales.
autoDetectLocalebooleanNoundefinedWhether to automatically detect the user’s preferred locale from browser settings or other sources. When true, the application will attempt to match the user’s preference with supported locales.
Property/MethodTypeDescription
themeThemeCurrent active theme object containing all theme properties
themeModeThemeModeCurrent theme mode (light/dark/system)
isDarkbooleanBoolean indicating if the current theme is in dark mode
activePresetstring?Optional string identifying the currently active preset
setThemeMode(mode: ThemeMode) => voidFunction to change the theme mode
updateCustomTheme(customTheme: Partial<Theme>, preset?: string, presetConfig?: (isDark: boolean) => Partial<Theme>) => voidFunction to update the custom theme with optional preset and configuration
resetTheme() => voidFunction to reset the theme to its default state