DirectoryFast
  • 🚀Get Started
  • 🔤Tutorials
    • Bring me to life!
    • How it's structured?
    • Make it yours
    • Bonus
  • 🛠️Features
    • AI
      • AI URL Scanner & Scan Jobs
    • Analytics
    • Authentication
    • API
      • Protected Endpoints
    • Blog
    • Database
    • Emails
    • Error Pages
    • Icons
    • Payments
    • Private Pages
    • SEO
  • 📦General Components
    • Shadcn/ui Components
    • Navbar
    • Footer
    • SignIn Modal
    • Hero Section
    • Social Proof
    • Collections Social Proof
    • Featured Section
    • Latest Collections Section
    • Latest Products Section
    • Recommended Section
  • 📦Directory Components
    • Product Card
    • Collection Card
    • Product Note
    • Search Bar
    • Tags
    • Product Options Toggle
    • Combobox
    • Multi-Combobox
    • Submit Product
    • Feature Product
    • Manage Note
    • Manage Collection
    • Dashboard Tables
  • ⛓️Links
    • GitHub Repository
    • Support
Powered by GitBook
On this page
  1. Directory Components

Product Options Toggle

Filter Products by their options.

PreviousTagsNextCombobox

Last updated 11 months ago

  • Component: <ProductTypeToggle/>

  • Path: /components/home/product-type-toggle.tsx

  • Import:

import { ProductTypeToggle } from "@/components/home/product-type-toggle.tsx";

This simple Toggle allows users to filter out products depending on the options you defined in your /data/config/metadata.js file (option1Label)

By default all products are shown regardless of their options. You can modify this behavior by updating defaultPressed :

product-type-toggle.tsx
<Toggle
    value="option1"
    aria-label={`Toggle ${metadata.option1Label}`}
    onClick={() => handleToggle("option1")}
    defaultPressed={selectedProductTypes.includes("option1")}
>
📦
Product Options Toggle