부품 본문 구역
마무리 띠 cta-band
페이지 끝에서 문의·예약으로 보내는 띠. 사진을 주면 사진 위에 강조색 단색 막을, 없으면 짙은 띠를 깐다. 버튼 하나 또는 둘.
설치
shadcn/ui 를 쓰는 Next.js 프로젝트에서 한 줄로 설치됩니다. 파일은 components/bpublish/cta-band.tsx 로 들어오고, 공통 토큰(base)도 같이 설치됩니다. 테마는 테마에서 하나 고릅니다.
npx shadcn@latest add https://www.bpublish.com/r/cta-band.json레지스트리를 등록했다면 npx shadcn@latest add @bpublish/cta-band · 설치 안내
AI에게 맡기기
Claude Code, Cursor 같은 AI 코딩 도구에 붙여 넣으세요. MCP 서버를 연결해 두면 이름만 말해도 됩니다.
bpublish UI의 마무리 띠(cta-band) 부품으로 만들어 줘. 설치: npx shadcn@latest add https://www.bpublish.com/r/cta-band.json · 문서: https://www.bpublish.com/designs/components/cta-band사용 예시
import { CtaBand } from '@/components/bpublish/cta-band'
export default function Example() {
return (
<>
<CtaBand
image={'/images/cta.webp'}
title="도면만 보내 주시면 이틀 안에 견적을 드립니다"
description="소량 시제품부터 월 수만 개 양산까지, 담당 엔지니어가 직접 검토합니다."
primary={{ label: '견적 문의하기', href: '#contact' }}
secondary={{ label: '회사소개서 내려받기', href: '#brochure' }}
/>
<CtaBand title="사진이 없으면 짙은 띠로" description="image 를 비우면 테마의 inverse 색으로 깔립니다." primary={{ label: '문의하기', href: '#contact' }} />
</>
)
}속성
| 이름 | 형식 | 기본값 | 설명 |
|---|---|---|---|
title필수 | string | — | 제목 |
description | string | — | 설명 한 줄 |
primary필수 | { label: string; href: string } | — | 주 버튼 |
secondary | { label: string; href: string } | — | 보조 버튼 |
image | string | — | 배경 사진 주소. 주면 강조색 막(85%)을 덮는다 |
원본 코드
설치 명령 없이 그대로 복사해 넣어도 됩니다. React 외의 패키지는 쓰지 않습니다.
/**
* bpublish UI — 마무리 띠. https://www.bpublish.com/designs/components/cta-band
* 페이지 끝에서 문의·예약으로 보내는 띠. 사진을 주면 사진 위에 강조색 막을, 없으면 짙은 띠를 깐다.
*/
export type CtaAction = { label: string; href: string }
export type CtaBandProps = {
title: string
description?: string
primary: CtaAction
secondary?: CtaAction
/** 배경 사진. 주면 강조색 막(85%)을 덮는다 */
image?: string
className?: string
}
export function CtaBand({ title, description, primary, secondary, image, className = '' }: CtaBandProps) {
const onPhoto = Boolean(image)
return (
<section className={`relative isolate py-20 text-center md:py-28 ${onPhoto ? 'text-primary-foreground' : 'bg-inverse text-inverse-foreground'} ${className}`}>
{image ? (
<>
<img src={image} alt="" className="absolute inset-0 -z-10 h-full w-full bg-muted object-cover" />
<span aria-hidden className="absolute inset-0 -z-10 bg-primary opacity-85" />
</>
) : null}
<div className="shell">
<h2 className="heading mx-auto max-w-3xl text-3xl leading-tight text-balance md:text-5xl">{title}</h2>
{description ? <p className="mx-auto mt-5 max-w-xl text-[15px] leading-7 opacity-85 md:text-base">{description}</p> : null}
<div className="mt-10 flex flex-col items-center justify-center gap-3 sm:flex-row">
<a
href={primary.href}
className={`inline-flex h-14 w-full items-center justify-center rounded-lg px-9 font-semibold transition-opacity hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-current sm:w-auto ${
onPhoto ? 'bg-primary-foreground text-primary' : 'bg-primary text-primary-foreground'
}`}
>
{primary.label}
</a>
{secondary ? (
<a
href={secondary.href}
className="inline-flex h-14 w-full items-center justify-center rounded-lg border border-current/50 px-9 font-semibold transition-colors hover:bg-current/10 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-current sm:w-auto"
>
{secondary.label}
</a>
) : null}
</div>
</div>
</section>
)
}