부품 첫 화면

잡지식 첫 화면 hero-editorial

건축 잡지처럼 큰 제목 아래 사진 두세 장을 비대칭으로 놓는 첫 화면. 큰 사진 한 장 옆으로 작은 사진이 엇갈려 내려가고, 아래 줄에 대표 작업의 이름·평수·지역을 적는다.

  • 나온 곳 결 스튜디오
  • 히어로
  • 첫 화면
  • 잡지
  • 명조
  • 포트폴리오
  • 인테리어
  • 비대칭 사진

설치

shadcn/ui 를 쓰는 Next.js 프로젝트에서 한 줄로 설치됩니다. 파일은 components/bpublish/hero-editorial.tsx 로 들어오고, 공통 토큰(base)도 같이 설치됩니다. 테마는 테마에서 하나 고릅니다.

npx shadcn@latest add https://www.bpublish.com/r/hero-editorial.json

레지스트리를 등록했다면 npx shadcn@latest add @bpublish/hero-editorial · 설치 안내

AI에게 맡기기

Claude Code, Cursor 같은 AI 코딩 도구에 붙여 넣으세요. MCP 서버를 연결해 두면 이름만 말해도 됩니다.

bpublish UI의 잡지식 첫 화면(hero-editorial) 부품으로 만들어 줘. 설치: npx shadcn@latest add https://www.bpublish.com/r/hero-editorial.json · 문서: https://www.bpublish.com/designs/components/hero-editorial

사용 예시

app/page.tsx
import { HeroEditorial } from '@/components/bpublish/hero-editorial'

export default function Example() {
  return (
    <HeroEditorial
      eyebrow="Interior Architecture, Seoul"
      title={['집은 사는 사람의', '하루에 맞춰 설계합니다.']}
      side={['주거·상업 인테리어 설계 시공', '서울 성동구 성수동', 'Since 2016']}
      photos={[
        { src: '/images/hero.webp', alt: '옥수동 아파트 거실. 한강을 향한 큰 창 앞에 낮은 참나무 수납장과 베이지 소파가 놓여 있다' },
        { src: '/images/studio-drafting.webp', alt: '설계실에서 디자이너가 제도판 위에 평면도를 그리고 있다', caption: '설계실, 성수동' },
        { src: '/images/material-oak.webp', alt: '결이 곧게 난 참나무 원목 마루판 근접 사진', caption: '참나무 원목 마루' },
      ]}
      feature={{ label: 'No. 01', name: '옥수동 아파트', meta: ['34평', '성동구 옥수동', '2025'] }}
      action={{ label: '작업 전체 보기', href: '/works' }}
    />
  )
}

속성

이름형식기본값설명
title필수string | string[]—제목. 배열로 주면 한 줄씩 끊는다
eyebrowstring—제목 위 영문 소제목
sidestring[]—제목 오른쪽의 짧은 정보 몇 줄 (분야, 위치, 연도)
photos필수{ src: string; alt: string; caption?: string }[]—사진 1–3장. 첫 장은 크게, 나머지는 오른쪽에 엇갈려 놓인다
feature{ label?: string; name: string; meta?: string[] }—아래 줄의 대표 작업 (번호, 이름, 평수·지역·연도)
action{ label: string; href: string }—아래 줄 오른쪽 링크

원본 코드

설치 명령 없이 그대로 복사해 넣어도 됩니다. React 외의 패키지는 쓰지 않습니다.

components/bpublish/hero-editorial.tsx
/**
 * bpublish UI — 잡지식 첫 화면. https://www.bpublish.com/designs/components/hero-editorial
 * 큰 제목과 비대칭으로 놓인 사진 두세 장, 사진마다 작은 캡션. 큰 사진 아래 줄에 대표 작업 이름과 정보를 적는다.
 */
export type EditorialPhoto = { src: string; alt: string; caption?: string }

export type HeroEditorialProps = {
  /** 제목. 배열로 주면 한 줄씩 끊는다 */
  title: string | string[]
  eyebrow?: string
  /** 제목 오른쪽의 짧은 정보 몇 줄(분야, 위치, 연도 등) */
  side?: string[]
  /** 첫 장은 크게, 둘째·셋째 장은 오른쪽에 엇갈려 놓인다. 1–3장 */
  photos: EditorialPhoto[]
  /** 큰 사진 아래 줄: 번호, 이름, 정보(평수·지역·연도 등) */
  feature?: { label?: string; name: string; meta?: string[] }
  /** 아래 줄 오른쪽 링크 */
  action?: { label: string; href: string }
  className?: string
}

function Meta({ items }: { items: string[] }) {
  return (
    <span className="flex flex-wrap items-center gap-x-3 text-[13px] text-muted-foreground tabular-nums">
      {items.map((v, i) => (
        <span key={v} className="flex items-center gap-3">
          {i > 0 ? <span aria-hidden className="h-3 w-px bg-muted-foreground/40" /> : null}
          {v}
        </span>
      ))}
    </span>
  )
}

export function HeroEditorial({ title, eyebrow, side = [], photos, feature, action, className = '' }: HeroEditorialProps) {
  const lines = Array.isArray(title) ? title : [title]
  const [main, ...rest] = photos
  const aside = rest.slice(0, 2)

  const foot =
    feature || action ? (
      <div className="mt-5 flex flex-col gap-4 border-b border-border pb-5 md:flex-row md:items-center md:justify-between">
        {feature ? (
          <p className="flex flex-wrap items-baseline gap-x-5 gap-y-2">
            {feature.label ? <span className="heading text-[15px] text-muted-foreground tabular-nums">{feature.label}</span> : null}
            <span className="heading text-[18px]">{feature.name}</span>
            {feature.meta?.length ? <Meta items={feature.meta} /> : null}
          </p>
        ) : (
          <span />
        )}
        {action ? (
          <a
            href={action.href}
            className="group inline-flex shrink-0 items-center gap-3 self-start text-[14px] hover:text-muted-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring md:self-auto"
          >
            {action.label}
            <span aria-hidden className="transition-transform group-hover:translate-x-1">
              →
            </span>
          </a>
        ) : null}
      </div>
    ) : null

  return (
    <section className={className}>
      <div className="shell grid gap-8 pt-12 pb-10 md:grid-cols-12 md:items-end md:gap-x-6 md:pt-20 md:pb-14">
        <div className="md:col-span-9">
          {eyebrow ? <p className="text-xs font-semibold tracking-[0.2em] text-primary uppercase">{eyebrow}</p> : null}
          <h1 className={`heading text-[38px] leading-[1.28] text-balance md:text-[60px] lg:text-[76px] lg:leading-[1.2] ${eyebrow ? 'mt-6' : ''}`}>
            {lines.map((l, i) => (
              <span key={i} className="block">
                {l}
              </span>
            ))}
          </h1>
        </div>
        {side.length ? (
          <ul className="space-y-1 border-t border-border pt-5 text-[13px] text-muted-foreground md:col-span-3 md:border-0 md:pt-0 md:text-right">
            {side.map((s) => (
              <li key={s}>{s}</li>
            ))}
          </ul>
        ) : null}
      </div>

      <div className="shell">
        <div className="grid gap-y-10 md:grid-cols-12 md:gap-x-6">
          {main ? (
            <div className={aside.length ? 'md:col-span-8' : 'md:col-span-12'}>
              <figure>
                <div className={`-mx-5 overflow-hidden bg-muted md:mx-0 ${aside.length ? 'aspect-[4/5] md:aspect-[4/3]' : 'aspect-[4/5] md:aspect-[16/9]'}`}>
                  <img src={main.src} alt={main.alt} loading="eager" className="h-full w-full object-cover" />
                </div>
                {main.caption ? <figcaption className="mt-3 text-[12px] text-muted-foreground">{main.caption}</figcaption> : null}
              </figure>
              {foot}
            </div>
          ) : null}

          {aside.length ? (
            <div className="grid grid-cols-2 items-start gap-4 md:col-span-3 md:col-start-10 md:flex md:flex-col md:gap-10 md:pt-20">
              {aside.map((p, i) => (
                <figure key={p.src} className={i === 1 ? 'mt-14 md:mt-0 md:w-2/3 md:self-end' : aside.length === 1 ? 'col-span-2 ml-auto w-2/3 md:w-full' : ''}>
                  <div className={`overflow-hidden bg-muted ${i === 0 ? 'aspect-[3/4] md:aspect-[4/5]' : 'aspect-square'}`}>
                    <img src={p.src} alt={p.alt} className="h-full w-full object-cover" />
                  </div>
                  {p.caption ? <figcaption className="mt-3 text-[12px] text-muted-foreground">{p.caption}</figcaption> : null}
                </figure>
              ))}
            </div>
          ) : null}
        </div>

      </div>
    </section>
  )
}