Blog post editor
Create or edit a blog post: the slug rolls in from the title, autosave flips Saving… to Saved, word count and read time roll, tags pop, the featured star bounces, a search preview updates live and Publish flips the status.
Installation
Installation is available on the Startup and Business plans. Your personal install command appears here once you have access.
Usage
Import it, pass your props, and make it part of your product.
import { BlogPostEditor } from '@/components/component-kit/items/block-blog-post-editor';
export function Example() { return <BlogPostEditor onSave={(post) => console.log(post)} onPublish={(post) => console.log(post.slug)} />;}Props
| Prop | Type | Default | Description |
|---|---|---|---|
post | Partial<BlogPostDraft> | undefined (new post) | Pass a post to edit it; omit to create one. Fields: title, slug, summary, content, tags, authors, featured, status. |
tagOptions | string[] | 5 demo tags | Tags that can be toggled on the post. |
authorOptions | string[] | 3 demo authors | Authors that can be added; avatars are DiceBear Lorelei by name. |
onSave | (post: BlogPostDraft) => void | undefined | Called after each debounced autosave. |
onPublish | (post: BlogPostDraft) => void | undefined | Called when the post is published. |
compact | boolean | false | Title, slug and publish only. |
autoPlay | boolean | false | Type a title on a loop. |