Entire store up to 50% off!

<p><strong>Entire store up to 50% off!</strong></p>
New arrivals, on sale now!
Learn More

Hero Banners Demo

Interactive demo and code examples for Fragment hero banner components

Hero Banner Implementation

Complete implementation with data fetching and display

TypeScript
import { fetchResource, ResourceType } from "fragment-headless-sdk";
import type { IHero, ListParams } from "fragment-headless-sdk";

async function fetchHeroBanners() {
  const heroBanners = 
    (await fetchResource<IHero>({
      baseUrl: process.env.FRAGMENT_BASE_URL!,
      apiKey: process.env.FRAGMENT_API_KEY!,
      type: ResourceType.HeroBanners
    })) ?? [];
    
  return heroBanners;
}

Installation

yarn add fragment-headless-sdk