부품 본문 구역

구역 머리 section-head

구역 맨 위의 영문 소제목, 제목, 한두 줄 설명. 넓은 화면에서 설명이 오른쪽으로 가는 배치와 가운데 정렬, 왼쪽 쌓기 세 가지.

설치

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

npx shadcn@latest add https://www.bpublish.com/r/section-head.json

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

AI에게 맡기기

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

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

사용 예시

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

export default function Example() {
  return (
    <div className="shell space-y-20 py-16">
      <SectionHead eyebrow="Business" title="도면 한 장에서 양산까지" description="반도체 장비, 2차전지, 의료기기 부품을 한 공장에서 가공하고 검사해 납품합니다." />
      <SectionHead align="center" eyebrow="Quality" title="출하 전 전수 검사" description="삼차원 측정기 4대로 모든 제품의 치수를 기록해 성적서와 함께 보냅니다." />
    </div>
  )
}

속성

이름형식기본값설명
title필수string—제목
eyebrowstring—제목 위 영문 소제목(강조색)
descriptionstring—한두 줄 설명
align'split' | 'center' | 'stack''split'배치

원본 코드

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

components/bpublish/section-head.tsx
/**
 * bpublish UI — 구역 머리. https://www.bpublish.com/designs/components/section-head
 * 구역 맨 위의 영문 소제목, 제목, 한두 줄 설명. 넓은 화면에서는 설명이 오른쪽으로 간다.
 */
export type SectionHeadProps = {
  title: string
  eyebrow?: string
  description?: string
  /** split: 제목 왼쪽, 설명 오른쪽 / center: 가운데 정렬 / stack: 왼쪽에 위아래로 */
  align?: 'split' | 'center' | 'stack'
  className?: string
}

export function SectionHead({ title, eyebrow, description, align = 'split', className = '' }: SectionHeadProps) {
  const wrap =
    align === 'split'
      ? 'flex flex-col gap-4 md:flex-row md:items-end md:justify-between md:gap-12'
      : align === 'center'
        ? 'mx-auto flex max-w-2xl flex-col items-center gap-4 text-center'
        : 'flex max-w-2xl flex-col gap-4'
  return (
    <div className={`${wrap} ${className}`}>
      <div>
        {eyebrow ? <p className="text-xs font-semibold tracking-[0.2em] text-primary uppercase">{eyebrow}</p> : null}
        <h2 className={`heading text-3xl leading-tight text-balance md:text-[2.75rem] ${eyebrow ? 'mt-3' : ''}`}>{title}</h2>
      </div>
      {description ? (
        <p className={`text-[15px] leading-7 text-muted-foreground ${align === 'split' ? 'max-w-md md:text-right' : ''}`}>{description}</p>
      ) : null}
    </div>
  )
}

함께 쓰는 부품