1.3.20 • Published 4 months ago

alif-ui v1.3.20

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

Installation

npm install alif-ui
yarn add alif-ui

Usage

  • brand: This prop sets the brand for your application and should be one of the following options: 'alif', 'alifshop', or 'aliftech'.
  • initialMode: This prop sets the initial theme mode for your application and can be either 'light' or 'dark'. Note: You can easily change the mode with useMode hook provided by this library

To use the alif-ui components in your project, follow these steps:

For a Standard React Application

Wrap your application with the AlifProvider.

import { AlifProvider } from 'alif-ui';
import 'alif-ui/styles.css';

function App() {
	return (
		<AlifProvider brand="alif" initialMode="light">
			{/* Your application components */}
		</AlifProvider>
	);
}

export default App;

For a Next.js Application

To integrate AlifProvider into a Next.js application follow these steps:

1. Create a Client-Side Wrapper Component File: components/ClientProviderWrapper.tsx

'use client';

import { ReactNode } from 'react';
import { AlifProvider } from 'alif-ui';
import 'alif-ui/styles.css';

interface ClientProviderWrapperProps {
	children: ReactNode;
}

const ClientProviderWrapper = ({ children }: ClientProviderWrapperProps) => {
	return (
		<AlifProvider initialMode="light" brand="alif">
			{children}
		</AlifProvider>
	);
};

export default ClientProviderWrapper;

Using the App Router

2. Update the Root Layout File: app/layout.tsx

import { ReactNode } from 'react';
import ClientProviderWrapper from '../components/ClientProviderWrapper';

interface RootLayoutProps {
	children: ReactNode;
}

const RootLayout = ({ children }: RootLayoutProps) => {
	return (
		<html lang="en">
			<body>
				<ClientProviderWrapper>{children}</ClientProviderWrapper>
			</body>
		</html>
	);
};

export default RootLayout;

Using the Pages Router

2. Update the App Component file: pages/_app.tsx

import type { AppProps } from 'next/app';
import ClientProviderWrapper from '../components/ClientProviderWrapper';

export default function App({ Component, pageProps }: AppProps) {
	return (
		<ClientProviderWrapper>
			<Component {...pageProps} />
		</ClientProviderWrapper>
	);
}

Documentation

Visit https://ui.alif.tj to view the full documentation.

1.3.19

4 months ago

1.3.20

4 months ago

1.3.18

5 months ago

1.3.17

5 months ago

1.3.15

5 months ago

1.3.16

5 months ago

1.3.10

7 months ago

1.3.9

7 months ago

1.3.13

7 months ago

1.3.14

7 months ago

1.3.11

7 months ago

1.3.12

7 months ago

1.3.7

7 months ago

1.2.7

7 months ago

1.2.6

7 months ago

1.2.5

7 months ago

1.2.4

7 months ago

1.2.3

7 months ago

1.2.2

7 months ago

1.2.1

7 months ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago