@7sikandar/af-components
v0.1.2
Published
API Freaks Components
Readme
af-components
Reusable React/Next.js component library for API Freaks.
Installation
npm install @7sikandar/af-components
# or
yarn add @7sikandar/af-componentsUsage
Import Components
import {
NavBarGlobal,
Footer,
NoPrefetchLink,
DropDownMenu,
MobileNavigationGlobal,
SearchBar,
SiteSearchBarComponent
} from '@7sikandar/af-components';Import Icons and Utils
import {
FacebookIcon,
TwitterIcon,
LinkedinIcon,
// ... other icons
} from '@7sikandar/af-components';
import {
navigationLinksPublic,
pageUrl,
contentApi,
// ... other utilities
} from '@7sikandar/af-components';Import Styles (Required)
You must import the CSS for styles and Tailwind utilities:
// In your app entry (e.g., _app.js, layout.tsx, or main.js)
import '@7sikandar/af-components/dist/af-components.css';Optional: Extend Tailwind Config
If you want to extend the default Tailwind config in your host repo:
// tailwind.config.js in your host repo
const afConfig = require('@7sikandar/af-components/tailwind.config');
module.exports = {
presets: [afConfig],
content: [
'./src/**/*.{js,ts,jsx,tsx}',
// your content paths
],
// ...your custom config
};Standalone Usage
This package works standalone whether your host repo uses Tailwind CSS or not:
- With Tailwind: Import the CSS and optionally extend the config
- Without Tailwind: Just import the CSS - all styles are pre-built and included
Components
Navigation Components
NavBarGlobal- Main navigation barFooter- Site footerMobileNavigationGlobal- Mobile navigation
Common Components
NoPrefetchLink- Link without prefetchDropDownMenu- Dropdown menu component
Search Components
SearchBar- Basic search barSiteSearchBarComponent- Advanced site search
Development
Building the Package
npm run build:packagePublishing
npm publishLocal Development
npm link
# In your test project:
npm link @7sikandar/af-componentsThis is a Next.js project bootstrapped with create-next-app.
Getting Started
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
Learn More
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
Deploy on Vercel
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
// "@tryghost/admin-api": "^1.13.17", // "@tryghost/content-api": "^1.11.28", // "fuse.js": "^7.1.0",
