Skip to main content
Our new developer certification is live!

ContentActions

Provides action buttons for blog posts, guides, and kickstarts including copying content for LLM and viewing as markdown.

Props

PropTypeRequiredDefaultDescription
contentBlogpost | Guide | KickstartYes-Content data from Contentstack
type'blog' | 'guide' | 'kickstart'Yes-Content type to determine field names and routes
classNamestringNo''Additional CSS classes for the wrapper
layout'stacked' | 'inline'No'stacked'Layout style for actions

Usage

import ContentActions from '@/components/organisms/ContentActions';

// For blog posts
<ContentActions content={blogPost} type="blog" />

// For guides
<ContentActions content={guide} type="guide" />

// For kickstarts
<ContentActions content={kickstart} type="kickstart" />

// Inline layout (header/meta row)
<ContentActions content={guide} type="guide" layout="inline" />

Features

  • Copy for LLM: Formats content (title, authors, dates, content) for LLM consumption and copies to clipboard
  • View as Markdown: Links to markdown version at /blog/[slug].md or /guides/[...slug].md
  • Shows "Copied!" feedback when content is copied
  • Uses icons from the Icons component
  • Works with blog posts, guides, and kickstarts

Actions

Copy for LLM

Formats the content into a structured text format including:

  • Title (from blog_content.title or guide_content.title)
  • Authors
  • Published/Updated dates (date fallback to created_at)
  • Full content text

View as Markdown

Links to the markdown route for the current content:

  • Blogs: /blog/[slug].md
  • Guides: /guides/[...slug].md
  • Kickstarts: /kickstarts/[...slug].md

Notes

  • Client-side component (uses 'use client')
  • Uses usePathname to extract slug from current route
  • Copy feedback disappears after 2 seconds
  • Automatically handles different content field names based on type (blog_content, guide_content, kickstart_content)