Skip to content
Postkit

CodeGroup. A tabbed set of alternative code examples.

  • Technical content
  • Interactive
  • Stability · Initial
  • ::postkit-code-group
shell
npm install @postkit/chakra

Usage.

<CodeGroup
  label="Install Postkit"
  items='[{"label":"npm","code":"npm install @postkit/chakra","language":"shell"},{"label":"pnpm","code":"pnpm add @postkit/chakra","language":"shell"}]'
/>

Props. Always in step with the code.

PropTypeDefaultDescription
itemsRequiredJSON stringNoneA JSON array of labeled code examples.
labelstring"Code examples"An accessible label for the code tabs.
initialIndexnumber0The initially selected code example.
Appearance
size"sm" | "md" | "lg""md"The component density and type scale.
variant"outline" | "subtle" | "plain""subtle"The component visual treatment.

Every component also takes unstyled and the part-styling props. Change a default for your whole site with defaults in createPostkit. Part styles

Anatomy. Every part is yours to restyle.

Every part

  • root
  • tabs
  • tab
  • panel

Renderers. One component, everywhere you publish.

  • Headless @postkit/reactSupported
  • Chakra @postkit/chakraSupported
  • Email @postkit/emailAs text
  • Astro @postkit/astroHydrated
  • Web components @postkit/elementsPlanned
Postkit

Richer posts, written once, right everywhere.

© 2026 Postkit. MIT licensed.
LicensingPrivacy