부품 본문 구역
진행 절차 steps
번호 붙은 단계 3–6개. 넓은 화면에서는 굵은 가로선 위에 번호 칸이 얹히고, 모바일에서는 세로선을 따라 내려간다. 상담·등록·납품 절차, 학기 커리큘럼에.
설치
shadcn/ui 를 쓰는 Next.js 프로젝트에서 한 줄로 설치됩니다. 파일은 components/bpublish/steps.tsx 로 들어오고, 공통 토큰(base)도 같이 설치됩니다. 테마는 테마에서 하나 고릅니다.
npx shadcn@latest add https://www.bpublish.com/r/steps.json레지스트리를 등록했다면 npx shadcn@latest add @bpublish/steps · 설치 안내
AI에게 맡기기
Claude Code, Cursor 같은 AI 코딩 도구에 붙여 넣으세요. MCP 서버를 연결해 두면 이름만 말해도 됩니다.
bpublish UI의 진행 절차(steps) 부품으로 만들어 줘. 설치: npx shadcn@latest add https://www.bpublish.com/r/steps.json · 문서: https://www.bpublish.com/designs/components/steps사용 예시
import { Steps } from '@/components/bpublish/steps'
export default function Example() {
return (
<div className="shell space-y-20 py-16 md:py-24">
<section>
<h2 className="heading mb-10 text-3xl md:text-5xl">등록 절차</h2>
<Steps
items={[
{ title: '상담 예약', description: '전화나 홈페이지로 예약합니다.' },
{ title: '레벨 테스트', meta: '50분', description: '학년별 50분 시험을 봅니다.' },
{ title: '결과 상담', meta: '20분', description: '오답을 함께 보며 20분 상담합니다.' },
{ title: '반 배정', description: '수준과 시간에 맞는 반을 정합니다.' },
]}
/>
</section>
<section>
<h2 className="heading mb-10 text-3xl md:text-5xl">고3·N수 커리큘럼</h2>
<Steps
items={[
{ meta: '12월 – 2월', title: '기출 실수 유형 분석', description: '평가원 기출을 실수 유형 24가지로 다시 묶어 학생별 약점 목록을 만듭니다.' },
{ meta: '3월 – 6월', title: '고난도 문항 훈련', description: '킬러·준킬러 문항을 주 20문항씩 풀고 풀이 시간을 기록합니다.' },
{ meta: '6월 – 9월', title: '평가원 모의고사 대응', description: '6월·9월 모의평가 직후 1:1 상담으로 남은 기간의 학습량을 다시 정합니다.' },
{ meta: '10월 – 수능', title: '실전 모의고사', description: '수능과 같은 시간표로 주 2회 실전 모의고사를 치르고 당일 클리닉을 엽니다.' },
]}
/>
</section>
</div>
)
}속성
| 이름 | 형식 | 기본값 | 설명 |
|---|---|---|---|
items필수 | { title: string; description?: string; meta?: string; no?: string }[] | — | 단계 3–6개. meta 는 제목 위 작은 글(기간·소요 시간), no 는 번호 대신 쓸 글자 |
원본 코드
설치 명령 없이 그대로 복사해 넣어도 됩니다. React 외의 패키지는 쓰지 않습니다.
/**
* bpublish UI — 진행 절차. https://www.bpublish.com/designs/components/steps
* 번호 붙은 단계 3–6개. 넓은 화면에서는 굵은 가로선 위에 번호가 얹히고, 모바일에서는 세로선을 따라 내려간다.
*/
export type StepItem = {
title: string
description?: string
/** 단계 위 작은 글(기간·소요 시간 등). '12월 – 1월' '50분' */
meta?: string
/** 번호 대신 쓸 글자. 비우면 1, 2, 3 */
no?: string
}
export type StepsProps = {
items: StepItem[]
className?: string
}
const lgCols: Record<number, string> = {
3: 'lg:grid-cols-3',
4: 'lg:grid-cols-4',
5: 'lg:grid-cols-5',
6: 'lg:grid-cols-6',
}
export function Steps({ items, className = '' }: StepsProps) {
const n = items.length
return (
<ol className={`grid md:grid-cols-2 ${lgCols[n] ?? 'lg:grid-cols-4'} ${className}`}>
{items.map((s, i) => (
<li
key={s.title}
className="relative ml-5 border-l-[3px] border-foreground pb-10 pl-8 lg:ml-0 last:pb-0 md:last:pb-10 lg:border-t-[3px] lg:border-l-0 lg:pt-6 lg:pr-8 lg:pb-0 lg:pl-0 lg:last:pb-0"
>
<span className="heading absolute top-0 -left-[1.5px] flex h-10 w-10 -translate-x-1/2 items-center justify-center bg-primary text-xl leading-none text-primary-foreground tabular-nums lg:-top-[1.5px] lg:left-0 lg:translate-x-0 lg:-translate-y-1/2">
{s.no ?? i + 1}
</span>
<div className="pt-1 lg:pt-6">
{s.meta ? <p className="text-[13px] font-semibold text-muted-foreground tabular-nums">{s.meta}</p> : null}
<h3 className={`text-xl font-semibold md:text-[21px] ${s.meta ? 'mt-1' : ''}`}>{s.title}</h3>
{s.description ? <p className="mt-2 text-[15px] leading-[1.75] text-muted-foreground">{s.description}</p> : null}
</div>
</li>
))}
</ol>
)
}