CodeGroup. A tabbed set of alternative code examples.
- Technical content
- Interactive
- Stability · Initial
- ::postkit-code-group
shell
npm install @postkit/chakrashell
pnpm add @postkit/chakraUsage.
<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.
| Prop | Type | Default | Description |
|---|---|---|---|
| itemsRequired | JSON string | None | A JSON array of labeled code examples. |
| label | string | "Code examples" | An accessible label for the code tabs. |
| initialIndex | number | 0 | The 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