Skip to main content
Version: 1.0.3

Settings

Settings Page is a highly customizable, animation-rich component designed for modern applications.

It supports:

  • Theme switching (light / dark / auto)
  • Language selection (UI-agnostic, consumer-controlled)
  • Timezone management with live time preview
  • Notification & privacy toggles
  • Action confirmations (e.g. data export)
  • Smooth, configurable animations

Installation

ignix add component settingsPage

Usage

import { SettingsPage } from '@ignix-ui/settingpage';
import { I18nProvider } from "@src/components/templates/settingspage/i18n";

type Messages = Record<string, string>;

function App() {
const [language, setLanguage] = useState("en");
const [messages, setMessages] = useState<Messages>({});

const loadLanguage = useCallback(async (lang: string) => {
const data = await fetch(`/i18n/${lang}.json`).then((r) => r.json());
console.log(data);
setMessages(data);
}, []);

const t = useCallback((key: string) => messages[key] ?? key, [messages]);

return (
<I18nProvider
value={{
language,
setLanguage,
t,
onLanguageChange: loadLanguage,
}}
>
<SettingsPage
languages={[
{ code: "en", name: "English", native: "English" },
{ code: "de", name: "German", native: "Deutsch" },
{ code: "ja", name: "Japanese", native: "日本語" },
{ code: "hi", name: "Hindi", native: "Hindi" },
]}
onNotificationsChange={(all) => {
fetch("/api/preferences", {
method: "POST",
body: JSON.stringify(all),
});
}}
onPrivacysChange={(all) => {
fetch("/api/preferences", {
method: "POST",
body: JSON.stringify(all),
});
}}
/>
</I18nProvider>
);
}

export default App;

Examples

Integrated with Layout

Dynamic translation loading

SettingsPage does not bundle translations.

To support language switching, provide an onLanguageChange handler via I18nProvider.

const loadLanguage = async (lang: string) => {
const messages = await fetch(`/i18n/${lang}.json`).then(r => r.json());
setMessages(messages);
};

<I18nProvider
value={{
language,
setLanguage,
t,
onLanguageChange: loadLanguage,
}}
>
<SettingsPage />
</I18nProvider>

Props

Core Configuration

PropTypeDefaultDescription
languagesLanguageOption[][{ code: "en", name: "English", native: "English" }]Language options shown in the language selector. Translation logic is owned by the consumer.
theme"auto" | "light" | "dark""light"Visual theme mode. auto follows system preferences.
animationVariant"none" | "fade" | "slide" | "scale" | "spring" | "stagger""slide"Controls page-level and card-level animations.

Animation Controls

PropTypeDefaultDescription
dropDownAnimation"default" | "fade" | "scale" | "slide" | "flip""default"Animation style for dropdown menus.
dialogAnimation"popIn" | "springPop" | "backdropZoom" | "flip3D" | "skewSlide" | "glassBlur" | "skyDrop""popIn"Animation used by confirmation dialogs.
switchAnimation"default" | "bounce" | "scale" | "rotate" | "fade" | "elastic" | "pulse" | "shake" | "flip" | "jelly" | "glow""bounce"Animation style for toggle switches.

Notifications & Privacy

PropTypeDefaultDescription
notificationOptionsNotificationOption[][{ id: "email", label: "Email Notification", defaultChecked: true }]Notification toggle configuration.
privacyOptionsPrivacyOption[][{ id: "everybody", label: "Everybody", defaultChecked: true }]Privacy preference toggles.
onNotificationChange(id, checked, all) => voidFired when a single notification toggle changes.
onNotificationsChange(all) => voidFired when notification state updates.
onPrivacyChange(id, checked, all) => voidFired when a single privacy toggle changes.
onPrivacysChange(all) => voidFired when privacy state updates.

Actions

PropTypeDefaultDescription
onExportData() => void | Promise<void>Called after export confirmation dialog is accepted.