부품 본문 구역

사진 타일 photo-tiles

사진 위에 영문 한 줄과 제목이 올라간 큰 타일 묶음(사업 분야, 브랜드, 지점). 2·3·4칸이고 화면 가장자리까지 채울 수 있다. 넓은 화면에서 마우스를 올리면 막이 짙어지며 설명이 드러난다.

  • 나온 곳 한결정밀
  • 사업 분야
  • 타일
  • 사진 카드
  • 호버
  • 격자

설치

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

npx shadcn@latest add https://www.bpublish.com/r/photo-tiles.json

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

AI에게 맡기기

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

bpublish UI의 사진 타일(photo-tiles) 부품으로 만들어 줘. 설치: npx shadcn@latest add https://www.bpublish.com/r/photo-tiles.json · 문서: https://www.bpublish.com/designs/components/photo-tiles

사용 예시

app/page.tsx
import { PhotoTiles } from '@/components/bpublish/photo-tiles'
import { SectionHead } from '@/components/bpublish/section-head'

export default function Example() {
  return (
    <section className="py-16 md:py-24">
      <div className="shell">
        <SectionHead eyebrow="Business" title="사업 분야" description="한 공장에서 가공부터 측정까지 마치는 네 갈래의 정밀 부품 사업입니다." className="mb-10 md:mb-14" />
      </div>
      <PhotoTiles
        bleed
        items={[
          {
            title: 'CNC 정밀 가공',
            eyebrow: 'CNC Machining',
            image: '/images/biz-machining.webp',
            href: '/business#machining',
            description: '5축 머시닝센터와 CNC 선반으로 알루미늄, 스테인리스, 티타늄, 엔지니어링 플라스틱을 시제품부터 양산까지 가공합니다.',
          },
          {
            title: '반도체 장비 부품',
            eyebrow: 'Semiconductor Equipment',
            image: '/images/biz-semi.webp',
            href: '/business#semiconductor',
            description: '증착·식각 장비의 챔버 부품과 웨이퍼 이송 부품을 고청정 공정 기준에 맞춰 가공하고 세정·포장까지 마칩니다.',
          },
          {
            title: '2차전지 설비 부품',
            eyebrow: 'Battery Manufacturing',
            image: '/images/biz-battery.webp',
            href: '/business#battery',
            description: '전극 공정과 조립 공정 설비에 들어가는 롤러, 지그, 커팅 부품을 내마모 소재와 표면 처리로 오래 쓰도록 만듭니다.',
          },
          {
            title: '의료·로봇 부품',
            eyebrow: 'Medical & Robotics',
            image: '/images/biz-medical.webp',
            href: '/business#medical',
            description: '수술 기구와 영상 장비, 협동 로봇의 관절 부품을 의료기기 품질 기준에 맞춰 추적 가능한 공정으로 생산합니다.',
          },
        ]}
      />
    </section>
  )
}

속성

이름형식기본값설명
items필수{ title: string; eyebrow?: string; description?: string; image: string; imageAlt?: string; href?: string }[]—타일들. description 은 마우스를 올렸을 때 드러난다(넓은 화면)
columns2 | 3 | 42넓은 화면의 칸 수. 칸 수에 따라 타일 비율이 바뀐다
bleedbooleanfalse페이지 폭(shell) 밖으로 화면 가장자리까지 채운다. 이때는 모서리를 둥글리지 않는다

원본 코드

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

components/bpublish/photo-tiles.tsx
/**
 * bpublish UI — 사진 타일. https://www.bpublish.com/designs/components/photo-tiles
 * 사진 위에 영문 한 줄과 제목이 올라간 큰 타일 묶음(사업 분야, 브랜드, 지점 등). 2·3·4칸.
 * 넓은 화면에서 마우스를 올리거나 초점이 가면 막이 짙어지고 설명이 드러난다.
 */
export type PhotoTile = {
  title: string
  eyebrow?: string
  description?: string
  image: string
  imageAlt?: string
  href?: string
}

export type PhotoTilesProps = {
  items: PhotoTile[]
  columns?: 2 | 3 | 4
  /** 화면 가장자리까지 채운다(shell 밖). 끄면 페이지 폭 안에 놓인다 */
  bleed?: boolean
  className?: string
}

const grid = {
  2: 'md:grid-cols-2',
  3: 'md:grid-cols-3',
  4: 'sm:grid-cols-2 lg:grid-cols-4',
}
const ratio = {
  2: 'aspect-[16/10] md:aspect-[16/9]',
  3: 'aspect-[16/10] md:aspect-[4/5]',
  4: 'aspect-[16/10] sm:aspect-[3/4]',
}
const size = {
  2: 'text-3xl md:text-[2.5rem]',
  3: 'text-3xl md:text-[2rem]',
  4: 'text-3xl md:text-[1.75rem]',
}

export function PhotoTiles({ items, columns = 2, bleed = false, className = '' }: PhotoTilesProps) {
  return (
    <div className={`${bleed ? '' : 'shell'} ${className}`}>
      <ul className={`grid grid-cols-1 gap-3 md:gap-5 ${grid[columns]}`}>
        {items.map((t) => {
          const Tag = t.href ? 'a' : 'div'
          return (
            <li key={t.title}>
              <Tag
                {...(t.href ? { href: t.href } : {})}
                className={`group relative isolate flex items-center justify-center overflow-hidden text-center text-white focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring ${ratio[columns]} ${bleed ? '' : 'rounded-lg'}`}
              >
                <img
                  src={t.image}
                  alt={t.imageAlt ?? ''}
                  loading="lazy"
                  className="absolute inset-0 -z-10 h-full w-full bg-muted object-cover transition-transform duration-700 group-hover:scale-105 group-focus-visible:scale-105"
                />
                <span aria-hidden className="absolute inset-0 -z-10 bg-black/40 transition-colors duration-500 group-hover:bg-black/60 group-focus-visible:bg-black/60" />
                <div className="px-6">
                  {t.eyebrow ? <p className="text-xs font-semibold tracking-[0.28em] uppercase opacity-80">{t.eyebrow}</p> : null}
                  <h3 className={`heading leading-tight text-balance ${size[columns]} ${t.eyebrow ? 'mt-2' : ''}`}>{t.title}</h3>
                  {t.description ? (
                    <p className="mx-auto mt-4 max-w-md text-sm leading-6 opacity-0 transition-opacity duration-500 group-hover:opacity-90 group-focus-visible:opacity-90 max-md:hidden">
                      {t.description}
                    </p>
                  ) : null}
                </div>
              </Tag>
            </li>
          )
        })}
      </ul>
    </div>
  )
}