Features Section
Layout
Showcase features and capabilities in a responsive grid layout.
Import
import {
PixelFeatures,
PixelFeatureItem,
PixelFeatureIcon,
PixelFeatureTitle,
PixelFeatureDescription,
PixelFeatureHeader,
PixelFeatureSectionTitle,
PixelFeatureSectionDescription
} from "@/components/ui/pixel/pixel-features"Usage
🚀
Fast
Blazing fast performance
🎨
Modern
Pixel-perfect design
🔧
Flexible
Fully customizable
Component Source
Copy and paste the following code into your project at /src/components/ui/pixel/pixel-features.tsx
import { cva, type VariantProps } from "class-variance-authority";
import * as React from "react";
import { cn } from "@/lib/utils";
const pixelFeaturesVariants = cva("relative w-full", {
variants: {
variant: {
default: "bg-[#f5f5dc] dark:bg-[#1a1a1a]",
primary: "bg-[#ff8c00] text-white",
secondary: "bg-[#ffd700] text-black",
dark: "bg-black text-white",
},
columns: {
1: "grid-cols-1",
2: "grid-cols-1 md:grid-cols-2",
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4",
},
gap: {
none: "gap-0",
sm: "gap-4",
md: "gap-8",
lg: "gap-12",
xl: "gap-16",
},
},
defaultVariants: {
variant: "default",
columns: 3,
gap: "lg",
},
});
export interface PixelFeaturesProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof pixelFeaturesVariants> {
children?: React.ReactNode;
}
const PixelFeatures = React.forwardRef<HTMLDivElement, PixelFeaturesProps>(
({ className, variant, columns, gap, children, ...props }, ref) => {
return (
<section
ref={ref}
className={cn(
pixelFeaturesVariants({ variant }),
"py-16 md:py-24",
className,
)}
{...props}
// ... (more code below)Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "default" | "primary" | "secondary" | "dark" | "default" | Background style of the features section |
| columns | 1 | 2 | 3 | 4 | 3 | Number of columns in the grid (responsive) |
| gap | "none" | "sm" | "md" | "lg" | "xl" | "lg" | Spacing between feature items |
| hover | "none" | "lift" | "glow" | "lift" | Hover effect animation for feature items |
Examples
Basic Features
Simple 3-column features grid
🚀
Fast
Blazing fast performance
🎨
Modern
Pixel-perfect design
🔧
Flexible
Fully customizable
With Header
Features section with title and description
🚀
Fast
Blazing fast performance
🎨
Modern
Pixel-perfect design
🔧
Flexible
Fully customizable
4-Column Layout
Wider grid with more features
🚀
Fast
Blazing fast performance
🎨
Modern
Pixel-perfect design
🔧
Flexible
Fully customizable
Dark Variant
Features section with dark background
🚀
Fast
Blazing fast performance
🎨
Modern
Pixel-perfect design
🔧
Flexible
Fully customizable
Accessibility
This component is built with accessibility in mind, including proper ARIA attributes, keyboard navigation, and focus management.