Steps Block (Astro)
contentbit/astro-stepsFreeComponent
Numbered process steps.
Install it
npx shadcn@latest add https://contentbit.dev/r/astro-steps.jsonSource
1---2import type { StepsData } from '@contentbit/blocks'3import type { ValidatedBlockNode } from '@contentbit/core'4import type { AstroBlockContext } from '@contentbit/astro'56interface Props {7 node: ValidatedBlockNode<unknown>8 ctx: AstroBlockContext9}1011const { node, ctx } = Astro.props12const data = node.data as StepsData13const last = data.items.length - 114const items = await Promise.all(15 data.items.map(async (item) => ({16 html: await ctx.renderMarkdown(item.text),17 })),18)19---2021<ol data-cb-styled class="my-6 list-none p-0">22 {23 items.map((item, i) => (24 <li class="relative flex gap-4 pb-7 last:pb-0">25 {i < last ? <span class="bg-border absolute top-7 bottom-1 left-[13px] w-px" aria-hidden="true" /> : null}26 <span class="bg-card text-foreground z-10 flex size-7 shrink-0 items-center justify-center rounded-full border font-mono text-xs font-semibold shadow-sm">27 {i + 1}28 </span>29 <div class="min-w-0 pt-1 text-sm leading-relaxed [&>p]:m-0 [&>p+p]:mt-2" set:html={item.html} />30 </li>31 ))32 }33</ol>
What it pulls in
npm packages
Files it writes
More from contentbit
All 20 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Callout Block (Astro)astro-callout | contentbit | Components | Free | 3 deps | |
| Comparison Block (Astro)astro-comparison | contentbit | Components | Free | 3 deps | |
| Content Renderer (Astro)astro-content-renderer | contentbit | Components | Free | 3 deps | |
| FAQ Block (Astro)astro-faq | contentbit | Components | Free | 3 deps | |
| Key Metrics Block (Astro)astro-key-metrics | contentbit | Components | Free | 3 deps | |
| Pros & Cons Block (Astro)astro-pros-cons | contentbit | Components | Free | 3 deps | |
| Quick Reference Block (Astro)astro-quick-ref | contentbit | Components | Free | 3 deps | |
| Tabs Block (Astro)astro-tabs | contentbit | Components | Free | 3 deps |
