doctor-templates
v0.1.10
Published
## Using npm
Downloads
2
Readme
Usage
Using npm
npm i doctor-templates@latest
Using yarn
yarn add doctor-templates@latest
Using pnpm
pnpm i doctor-templates@latest
Import the styles in your main application file (e.g., pages/_app.js
or app/layout.js
for Next.js):
import 'doctor-templates/styles.css';
Wrap your app with TemplateProvider
'use client';
import React, { ReactNode } from 'react';
import { TemplateProvider } from './TemplateProvider';
type ProvidersProps = {
children: ReactNode;
};
const Providers = ({ children }: ProvidersProps) => {
return (
<TemplateProvider initialTemplate={'template-3'}>
{children}
</TemplateProvider>
);
};
export default Providers;
Use the components in your application:
import { Navbar } from 'doctor-templates';
Use template switcher
import { useTemplate } from 'doctor-templates';
const { template, setTemplate } = useTemplate();
setTemplate('template-1')
setTemplate('template-2')
setTemplate('template-3')