부품 본문 구역

이야기 구역 story-split

한쪽에 큰 사진, 다른 쪽에 제목과 글을 놓는 소개 구역. 첫 단락은 제목체로 크게 쓰고, 번호 붙은 짧은 단락·숫자 세 칸·작은 사진 두 장을 골라 더한다. reverse 로 사진을 오른쪽에 둔다.

  • 나온 곳 밀담 베이커리
  • 소개
  • 이야기
  • 브랜드 스토리
  • 사진과 글
  • 좌우 배치
  • 단계

설치

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

npx shadcn@latest add https://www.bpublish.com/r/story-split.json

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

AI에게 맡기기

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

bpublish UI의 이야기 구역(story-split) 부품으로 만들어 줘. 설치: npx shadcn@latest add https://www.bpublish.com/r/story-split.json · 문서: https://www.bpublish.com/designs/components/story-split

사용 예시

app/page.tsx
import { StorySplit } from '@/components/bpublish/story-split'

export default function Example() {
  return (
    <>
      <StorySplit
        eyebrow="Our Story"
        title="2019년부터 연남동 골목에서 같은 르방을 이어 갑니다"
        image={{ src: '/images/shaping.webp', alt: '밀가루가 뿌려진 나무 작업대에서 제빵사가 두 손으로 반죽을 둥글게 성형하는 모습', caption: '새벽 5시, 전날 숙성한 반죽을 성형합니다.' }}
        lead="밀담은 제빵사 두 사람이 2019년 연남동 주택가 1층에 연 빵집입니다. 문을 열던 해 봄에 만든 르방을 지금도 매일 아침 밀가루와 물을 먹여 이어 쓰고 있습니다."
        paragraphs={[
          '빵 한 덩이가 진열대에 오르기까지 48시간이 걸립니다. 반죽을 4℃에서 천천히 숙성하면 발효에서 나온 산미와 밀의 단맛이 함께 살아나고, 속살이 사흘 동안 촉촉하게 유지됩니다.',
          '밀가루는 경남 진주의 앉은뱅이밀과 전북 익산의 금강밀을 씁니다. 두 농가가 수확한 밀을 매달 제분소에서 바로 받아, 갓 빻은 향이 남아 있을 때 반죽합니다.',
        ]}
        figures={[
          { value: '48', unit: '시간', label: '반죽에서 굽기까지' },
          { value: '4', unit: '℃', label: '저온 숙성 온도' },
          { value: '2', unit: '곳', label: '밀을 받는 국내 농가' },
        ]}
        details={[
          { src: '/images/levain.webp', alt: '유리병 안에서 기포를 머금고 부푼 르방', caption: '2019년 봄부터 이어 온 르방' },
          { src: '/images/flour.webp', alt: '나무 작업대 위 종이 포대에서 쏟아진 국산 통밀가루', caption: '매달 받는 진주·익산의 밀가루' },
        ]}
      />
      <StorySplit
        reverse
        numbered
        eyebrow="48 Hours"
        title="빵 한 덩이의 48시간"
        image={{ src: '/images/oven.webp', alt: '돌 오븐 입구에서 나무 삽으로 시골빵을 꺼내는 모습', caption: '하루 일곱 번 오븐 문이 열립니다.' }}
        paragraphs={[
          { title: '르방 먹이기', body: '1일 차 06:00. 이어 둔 르방에 밀가루와 물을 먹여 발효 힘을 올립니다.' },
          { title: '반죽과 접기', body: '1일 차 12:00. 르방과 소금을 넣고 한 시간 간격으로 네 번 접습니다.' },
          { title: '1차 저온 숙성', body: '1일 차 18:00. 4℃ 숙성고에서 24시간 동안 천천히 부풀립니다.' },
          { title: '성형과 2차 숙성', body: '2일 차 18:00. 한 덩이씩 모양을 잡아 바구니에 담고 밤새 다시 재웁니다.' },
          { title: '굽기', body: '3일 차 06:00. 250℃ 돌 오븐에서 40분 동안 껍질이 짙어질 때까지 굽습니다.' },
        ]}
      />
    </>
  )
}

속성

이름형식기본값설명
title필수string—제목
eyebrowstring—제목 위 영문 소제목
image필수{ src: string; alt: string; caption?: string }—큰 사진 (4:5)
leadstring—제목 아래 첫 단락. 제목체로 크게
paragraphs(string | { title: string; body: string })[]—본문 단락. 객체로 주면 소제목이 붙는다
numberedbooleanfalse단락 앞에 01, 02 … 번호를 붙이고 선으로 나눈다
figures{ value: string; unit?: string; label: string }[]—숫자 칸 (세 개가 보기 좋다)
details{ src: string; alt: string; caption?: string }[]—글 아래 작은 정사각 사진 두 장
reversebooleanfalse사진을 오른쪽에 둔다

원본 코드

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

components/bpublish/story-split.tsx
/**
 * bpublish UI — 이야기 구역. https://www.bpublish.com/designs/components/story-split
 * 한쪽에 큰 사진, 다른 쪽에 제목과 글. 첫 단락은 제목체로 크게, 나머지는 본문으로. 번호 붙은 짧은 단락, 숫자 세 칸, 작은 사진 두 장을 더할 수 있다.
 */
export type StoryPhoto = { src: string; alt: string; caption?: string }
export type StoryParagraph = string | { title: string; body: string }

export type StorySplitProps = {
  title: string
  eyebrow?: string
  /** 큰 사진 */
  image: StoryPhoto
  /** 제목 아래 첫 단락. 제목체로 크게 */
  lead?: string
  /** 본문 단락. { title, body } 로 주면 소제목이 붙는다 */
  paragraphs?: StoryParagraph[]
  /** 단락 앞에 01, 02 … 번호를 붙인다 */
  numbered?: boolean
  /** 숫자 칸 (최대 3개가 보기 좋다) */
  figures?: { value: string; unit?: string; label: string }[]
  /** 글 아래 작은 사진 두 장 */
  details?: StoryPhoto[]
  /** 사진을 오른쪽에 둔다 */
  reverse?: boolean
  className?: string
}

export function StorySplit({
  title,
  eyebrow,
  image,
  lead,
  paragraphs = [],
  numbered = false,
  figures = [],
  details = [],
  reverse = false,
  className = '',
}: StorySplitProps) {
  return (
    <section className={`py-16 md:py-24 ${className}`}>
      <div
        className={`shell grid gap-12 lg:gap-16 ${
          reverse ? 'lg:grid-cols-[minmax(0,1fr)_minmax(0,1.05fr)]' : 'lg:grid-cols-[minmax(0,1.05fr)_minmax(0,1fr)]'
        }`}
      >
        <figure className={reverse ? 'lg:order-2' : ''}>
          <div className="aspect-[4/5] overflow-hidden bg-muted">
            <img src={image.src} alt={image.alt} loading="lazy" className="h-full w-full object-cover" />
          </div>
          {image.caption ? <figcaption className="mt-3 text-[13px] text-muted-foreground">{image.caption}</figcaption> : null}
        </figure>

        <div className="flex flex-col">
          <div className="border-t border-foreground pt-6">
            {eyebrow ? <p className="text-xs font-semibold tracking-[0.2em] text-primary uppercase">{eyebrow}</p> : null}
            <h2 className={`heading text-3xl leading-[1.3] text-balance md:text-[2.5rem] ${eyebrow ? 'mt-3' : ''}`}>{title}</h2>
          </div>

          {lead ? <p className="heading mt-8 text-[20px] leading-[1.75] md:text-[23px]">{lead}</p> : null}

          {paragraphs.length ? (
            numbered ? (
              <ol className="mt-8 border-b border-border">
                {paragraphs.map((p, i) => (
                  <li key={i} className="grid grid-cols-[2.75rem_1fr] gap-x-3 border-t border-border py-5 md:grid-cols-[3.5rem_1fr]">
                    <span className="heading text-[20px] leading-none text-primary tabular-nums md:text-[24px]">{String(i + 1).padStart(2, '0')}</span>
                    <div>
                      {typeof p === 'string' ? null : <h3 className="heading text-[18px] leading-snug">{p.title}</h3>}
                      <p className={`text-[15px] leading-[1.85] text-muted-foreground ${typeof p === 'string' ? '' : 'mt-2'}`}>{typeof p === 'string' ? p : p.body}</p>
                    </div>
                  </li>
                ))}
              </ol>
            ) : (
              <div className="mt-6 space-y-5">
                {paragraphs.map((p, i) =>
                  typeof p === 'string' ? (
                    <p key={i} className="text-[15.5px] leading-[1.85] text-muted-foreground">
                      {p}
                    </p>
                  ) : (
                    <div key={i}>
                      <h3 className="heading text-[18px] leading-snug">{p.title}</h3>
                      <p className="mt-2 text-[15.5px] leading-[1.85] text-muted-foreground">{p.body}</p>
                    </div>
                  ),
                )}
              </div>
            )
          ) : null}

          {figures.length ? (
            <dl className="mt-10 grid grid-cols-3 border-y border-foreground">
              {figures.map((f, i) => (
                <div key={f.label} className={`flex flex-col-reverse justify-end py-5 ${i > 0 ? 'border-l border-border pl-4 md:pl-6' : ''}`}>
                  <dt className="mt-2.5 text-[12.5px] leading-snug text-muted-foreground md:text-[13.5px]">{f.label}</dt>
                  <dd className="heading leading-none">
                    <span className="text-[40px] tabular-nums md:text-[56px]">{f.value}</span>
                    {f.unit ? <span className="ml-1 text-[17px] md:text-[20px]">{f.unit}</span> : null}
                  </dd>
                </div>
              ))}
            </dl>
          ) : null}

          {details.length ? (
            <div className="mt-10 grid grid-cols-2 gap-4 lg:mt-auto lg:pt-10">
              {details.slice(0, 2).map((d) => (
                <figure key={d.src}>
                  <div className="aspect-square overflow-hidden bg-muted">
                    <img src={d.src} alt={d.alt} loading="lazy" className="h-full w-full object-cover" />
                  </div>
                  {d.caption ? <figcaption className="mt-2.5 text-[12.5px] leading-snug text-muted-foreground">{d.caption}</figcaption> : null}
                </figure>
              ))}
            </div>
          ) : null}
        </div>
      </div>
    </section>
  )
}