Menu

Change language

GitHub repo

Resources — Featured List

blockmarketing

Editorial resource layout pairing one featured long-read with a numbered list of further reading, each entry carrying its kind, date, and read time.

Installation

$npx uipkge-ng@latest add resources-featured-list
Manifest:https://uipkge.dev/r/angular/resources-featured-list.jsonInstalls to:src/app/components/blocks/resources-featured-list/

Variants

Loading interactive previews…

Files installed (2)

  • src/app/components/blocks/resources-featured-list/resources-featured-list.component.ts6.3 kB
    // Editorial resource layout pairing one featured long-read with a numbered list of
    // further reading, each entry carrying its kind, date, and read time. Port of the
    // React block 1:1.
    import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
    import { ArrowRight, ArrowUpRight, LucideAngularModule } from 'lucide-angular'
    import { cn } from '@/lib/utils'
    import { UiAvatarComponent, UiAvatarFallbackComponent } from '@/ui/avatar/avatar.component'
    import { UiBadgeComponent } from '@/ui/badge/badge.component'
    import { UiButtonComponent } from '@/ui/button/button.component'
    import { UiCardComponent, UiCardContentComponent } from '@/ui/card/card.component'
    import { UiSeparatorComponent } from '@/ui/separator/separator.component'
    
    const featured = {
      kind: 'Benchmark',
      title: 'What close speed actually looks like across 240 finance teams',
      excerpt:
        'We asked every customer for their close calendar before and after rollout, then threw out the ones who changed headcount mid-period. What is left is 186 teams and a distribution that is wider than any vendor page admits.',
      date: 'Mar 04, 2026',
      read: '11 min',
      author: { name: 'Anna Reyes', role: 'Data Lead', initials: 'AR' },
    }
    
    const further = [
      { title: 'Why we version metric definitions instead of dashboards', kind: 'Essay', date: 'Feb 18', read: '9 min' },
      { title: 'Query planning against three warehouses at once', kind: 'Deep dive', date: 'Feb 02', read: '14 min' },
      { title: 'A reconciliation checklist for your first close', kind: 'Guide', date: 'Jan 21', read: '6 min' },
      {
        title: 'Self-serve analytics fails for reasons that are not technical',
        kind: 'Opinion',
        date: 'Jan 09',
        read: '7 min',
      },
      { title: 'What our audit log actually records, field by field', kind: 'Reference', date: 'Dec 15', read: '5 min' },
    ]
    
    @Component({
      changeDetection: ChangeDetectionStrategy.Eager,
      selector: 'ui-resources-featured-list, [ui-resources-featured-list]',
      standalone: true,
      // The block renders its own root <section>: keep the host out of layout.
      host: { '[attr.class]': '"contents"' },
      imports: [
        LucideAngularModule,
        UiAvatarComponent,
        UiAvatarFallbackComponent,
        UiBadgeComponent,
        UiButtonComponent,
        UiCardComponent,
        UiCardContentComponent,
        UiSeparatorComponent,
      ],
      template: `
        <section data-slot="resources-featured-list" [class]="rootClass">
          <div class="mx-auto max-w-6xl px-6 py-20 lg:py-28">
            <div class="flex flex-wrap items-end justify-between gap-6">
              <div>
                <span ui-badge variant="secondary">Reading</span>
                <h2 class="mt-4 text-3xl font-semibold tracking-tight sm:text-4xl">Start here</h2>
              </div>
              <button ui-button variant="link" class="h-auto p-0 text-sm">
                All writing
                <lucide-icon [img]="ArrowRight" class="ml-1.5 size-3.5" />
              </button>
            </div>
    
            <div class="mt-10 grid gap-10 lg:grid-cols-[1.1fr_1fr] lg:gap-16">
              <div ui-card class="group">
                <div ui-card-content class="flex h-full flex-col p-6 lg:p-8">
                  <div class="flex flex-wrap items-center gap-3">
                    <span ui-badge variant="outline">{{ featured.kind }}</span>
                    <span class="text-muted-foreground text-xs">{{ featured.date }} · {{ featured.read }}</span>
                  </div>
                  <h3 class="mt-4 text-2xl leading-snug font-semibold tracking-tight text-balance">{{ featured.title }}</h3>
                  <p class="text-muted-foreground mt-3 leading-relaxed">{{ featured.excerpt }}</p>
    
                  <div class="mt-auto flex items-center gap-3 pt-8">
                    <ui-avatar class="size-9">
                      <ui-avatar-fallback class="text-xs">{{ featured.author.initials }}</ui-avatar-fallback>
                    </ui-avatar>
                    <div class="min-w-0">
                      <p class="truncate text-sm font-medium">{{ featured.author.name }}</p>
                      <p class="text-muted-foreground truncate text-xs">{{ featured.author.role }}</p>
                    </div>
                    <button ui-button variant="ghost" size="sm" class="ml-auto">
                      Read
                      <lucide-icon
                        [img]="ArrowUpRight"
                        class="ml-1 size-3.5 transition-transform group-hover:translate-x-0.5 group-hover:-translate-y-0.5"
                      />
                    </button>
                  </div>
                </div>
              </div>
    
              <div>
                <p class="text-muted-foreground font-mono text-xs tracking-[0.14em] uppercase">Further reading</p>
                <ol class="mt-4">
                  @for (entry of further; track entry.title; let i = $index; let last = $last) {
                    <li>
                      <a
                        href="#"
                        class="hover:bg-muted focus-visible:ring-ring group -mx-3 flex items-start gap-4 rounded-lg px-3 py-3 transition-colors focus-visible:ring-2 focus-visible:outline-none"
                      >
                        <span class="text-muted-foreground/70 mt-0.5 shrink-0 font-mono text-xs">
                          {{ (i + 1).toString().padStart(2, '0') }}
                        </span>
                        <span class="min-w-0 flex-1">
                          <span class="block text-sm leading-snug">{{ entry.title }}</span>
                          <span class="text-muted-foreground mt-1 block font-mono text-xs">
                            {{ entry.kind }} · {{ entry.date }} · {{ entry.read }}
                          </span>
                        </span>
                        <lucide-icon
                          [img]="ArrowUpRight"
                          class="text-muted-foreground mt-0.5 size-3.5 shrink-0 transition-transform group-hover:translate-x-0.5 group-hover:-translate-y-0.5"
                        />
                      </a>
                    </li>
                    @if (!last) {
                      <ui-separator />
                    }
                  }
                </ol>
              </div>
            </div>
          </div>
        </section>
      `,
    })
    export class UiResourcesFeaturedListComponent {
      protected readonly ArrowRight = ArrowRight
      protected readonly ArrowUpRight = ArrowUpRight
      protected readonly featured = featured
      protected readonly further = further
    
      @Input('class') className?: string
    
      get rootClass(): string {
        return cn('bg-background', this.className)
      }
    }
    
  • src/app/components/blocks/resources-featured-list/index.ts0.1 kB

Raw manifest:https://uipkge.dev/r/angular/resources-featured-list.json