Convert Figma logo to code with AI

tinacms logotinacms

A fully open-source headless CMS that supports Markdown and Visual Editing

12,604
650
12,604
264

Top Related Projects

66,400

🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable, and developer-first.

18,294

A Git-based CMS for Static Site Generators

14,923

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony

50,256

:globe_with_meridians: Jekyll is a blog-aware static site generator in Ruby

80,088

The world’s fastest framework for building websites.

Quick Overview

TinaCMS is an open-source content management system (CMS) designed for developers and content creators. It provides a flexible, Git-backed approach to managing content, allowing for real-time editing and seamless integration with modern web frameworks like Next.js and Gatsby.

Pros

  • Highly customizable and extensible
  • Git-based content management for version control and collaboration
  • Real-time visual editing experience
  • Seamless integration with popular static site generators and frameworks

Cons

  • Steeper learning curve compared to traditional CMS platforms
  • Limited ecosystem of plugins and extensions compared to more established CMS solutions
  • Requires developer expertise for setup and customization
  • May not be suitable for large-scale enterprise content management needs

Code Examples

  1. Setting up TinaCMS with Next.js:
// pages/_app.js
import { TinaProvider, TinaCMS } from 'tinacms'

function MyApp({ Component, pageProps }) {
  const cms = new TinaCMS({
    enabled: process.env.NODE_ENV !== "production",
    apis: {
      github: {
        authScope: 'repo',
      },
    },
  })

  return (
    <TinaProvider cms={cms}>
      <Component {...pageProps} />
    </TinaProvider>
  )
}

export default MyApp
  1. Creating a simple text field:
import { usePlugin } from 'tinacms'
import { useForm, useField } from 'react-tinacms-forms'

export default function Page() {
  const [modifiedData, form] = useForm({
    id: 'my-page',
    label: 'Edit Page',
    fields: [
      {
        name: 'title',
        label: 'Title',
        component: 'text',
      },
    ],
    loadInitialValues: async () => ({
      title: 'My Page Title',
    }),
    onSubmit: async () => {
      // Save the data
    },
  })

  usePlugin(form)

  return <h1>{modifiedData.title}</h1>
}
  1. Adding a markdown editor:
import { usePlugin } from 'tinacms'
import { useForm, useField } from 'react-tinacms-forms'
import { InlineForm } from 'react-tinacms-inline'
import { InlineWysiwyg } from 'react-tinacms-editor'

export default function Page() {
  const [data, form] = useForm({
    id: 'page-content',
    label: 'Page Content',
    fields: [
      {
        name: 'content',
        label: 'Content',
        component: 'markdown',
      },
    ],
    loadInitialValues: async () => ({
      content: '# Welcome to my page\n\nThis is some markdown content.',
    }),
    onSubmit: async () => {
      // Save the data
    },
  })

  usePlugin(form)

  return (
    <InlineForm form={form}>
      <InlineWysiwyg name="content" format="markdown">
        <div>{data.content}</div>
      </InlineWysiwyg>
    </InlineForm>
  )
}

Getting Started

To get started with TinaCMS in a Next.js project:

  1. Install TinaCMS:

    npm install tinacms react-tinacms-editor react-tinacms-inline
    
  2. Set up TinaCMS in your _app.js file (see first code example above).

  3. Create a form and fields in your page components (see second and third code examples).

  4. Run your development server and access the CMS sidebar by adding ?edit to your URL.

For more detailed instructions and advanced features, refer to the official TinaCMS documentation.

Competitor Comparisons

66,400

🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable, and developer-first.

Pros of Strapi

  • More comprehensive headless CMS solution with built-in admin panel and API generation
  • Larger community and ecosystem with extensive plugins and integrations
  • Better suited for complex content structures and multi-user environments

Cons of Strapi

  • Heavier and more resource-intensive, requiring a dedicated backend
  • Steeper learning curve due to its more complex architecture
  • Less flexible for in-place editing within existing React applications

Code Comparison

Strapi (Content Type Builder):

module.exports = {
  attributes: {
    title: {
      type: 'string',
      required: true,
    },
    content: {
      type: 'richtext',
    },
  },
};

TinaCMS (Schema Definition):

export const pageSchema = {
  label: 'Page',
  fields: [
    { name: 'title', label: 'Title', component: 'text' },
    { name: 'content', label: 'Content', component: 'markdown' },
  ],
};

Both Strapi and TinaCMS offer content management solutions, but they cater to different use cases. Strapi is a full-featured headless CMS with a robust backend, while TinaCMS focuses on providing a flexible, lightweight editing experience within React applications. The choice between them depends on project requirements, team expertise, and desired level of customization.

18,294

A Git-based CMS for Static Site Generators

Pros of Decap CMS

  • More mature project with a larger community and ecosystem
  • Supports a wider range of static site generators out of the box
  • Easier setup process for non-technical users

Cons of Decap CMS

  • Less flexible for custom integrations and workflows
  • Limited real-time preview capabilities compared to Tina CMS
  • Slower development pace and fewer recent updates

Code Comparison

Decap CMS configuration (config.yml):

backend:
  name: git-gateway
  branch: main
collections:
  - name: "blog"
    label: "Blog"
    folder: "content/blog"
    create: true
    fields:
      - {label: "Title", name: "title", widget: "string"}

Tina CMS configuration (tina/config.ts):

import { defineConfig } from "tinacms";

export default defineConfig({
  schema: {
    collections: [{
      name: "post",
      label: "Posts",
      path: "content/posts",
      fields: [
        { type: "string", name: "title", label: "Title" },
      ],
    }],
  },
});

Both CMSs use configuration files to define content models, but Tina CMS offers a more programmatic approach with TypeScript support, while Decap CMS uses a simpler YAML format.

14,923

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony

Pros of Grav

  • Lightweight and fast flat-file CMS, requiring no database
  • Extensive plugin ecosystem and theme marketplace
  • Built-in support for multiple languages and content types

Cons of Grav

  • Steeper learning curve for non-technical users
  • Limited built-in features for complex content management
  • Less suitable for large-scale, data-intensive websites

Code Comparison

Grav (PHP):

$page = $this->grav['page'];
$twig = $this->grav['twig'];
$config = $this->grav['config'];

$twig->twig_vars['custom_variable'] = $config->get('plugins.my_plugin.custom_variable');

TinaCMS (JavaScript):

import { useForm, usePlugin } from 'tinacms'

const [data, form] = useForm({
  initialValues: { title: 'Hello' },
  onSubmit: async () => { /* ... */ },
})

usePlugin(form)

While Grav focuses on server-side rendering and file-based content management, TinaCMS is a headless CMS that provides a flexible editing interface for various frontend frameworks. Grav offers a complete CMS solution out of the box, whereas TinaCMS is designed to be integrated into existing projects, providing a customizable editing experience.

50,256

:globe_with_meridians: Jekyll is a blog-aware static site generator in Ruby

Pros of Jekyll

  • Mature and stable project with a large community and extensive documentation
  • Simple, file-based structure that's easy to understand and manage
  • Faster build times for static sites, especially for smaller projects

Cons of Jekyll

  • Limited dynamic content capabilities without additional tools or plugins
  • Less flexible for complex, interactive web applications
  • Requires Ruby knowledge for advanced customization and plugin development

Code Comparison

Jekyll (Liquid template):

{% for post in site.posts %}
  <h2>{{ post.title }}</h2>
  <p>{{ post.excerpt }}</p>
{% endfor %}

TinaCMS (React component):

{props.data.posts.edges.map(({ node }) => (
  <div key={node.id}>
    <h2>{node.frontmatter.title}</h2>
    <p>{node.excerpt}</p>
  </div>
))}

TinaCMS offers a more modern, React-based approach with real-time editing capabilities, while Jekyll provides a simpler, static site generation process. TinaCMS is better suited for dynamic, content-focused websites, whereas Jekyll excels in creating lightweight, fast-loading static sites with minimal complexity.

80,088

The world’s fastest framework for building websites.

Pros of Hugo

  • Faster build times and better performance for static sites
  • Larger community and ecosystem with more themes and plugins
  • Simpler setup and deployment process for static websites

Cons of Hugo

  • Less flexible for dynamic content management
  • Steeper learning curve for non-technical users
  • Limited real-time editing capabilities

Code Comparison

Hugo (Go template):

{{ range .Pages }}
  <h2>{{ .Title }}</h2>
  {{ .Content }}
{{ end }}

TinaCMS (React component):

{data.posts.map((post) => (
  <div key={post.id}>
    <h2>{post.title}</h2>
    {post.content}
  </div>
))}

Hugo focuses on static site generation using Go templates, while TinaCMS provides a more dynamic, React-based approach for content management. Hugo excels in performance and simplicity for static sites, whereas TinaCMS offers greater flexibility for real-time editing and dynamic content. The choice between the two depends on the specific needs of the project, with Hugo being more suitable for static websites and TinaCMS better suited for projects requiring a more interactive content management experience.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

GitHub license npm version Build, Test, Lint for Main

TINA CMS

Tina Demo

Tina is a headless content management system with support for Markdown, MDX, JSON, YAML, and more.

It comes with a GraphQL API:

  • Query your Markdown content like this 👉 post.author.firstName
  • Supports statically generated and server side rendered pages
  • Supports references between documents

Tina offers a live preview (optional and opt-in) that makes editing Markdown files very intuitive for less-technical people.

Getting Started

Test a TinaCMS starter site locally

npx create-tina-app@latest

Or try a demo site on TinaCloud.

Documentation

Visit Tina's documentation to learn more.

Questions?

Tweet Forum

Visit the GitHub Discussions or our Community Discord to ask questions, or look us up on on Twitter at @tinacms.

🧑‍🎓 Earn a Tina Badge

Go the extra mile and earn a Tina Dev Badge 🦙: Earn a Tina Credly badge

Vision

To be the world-leading CMS with Git support that developers love.

Tech Stack

See https://tina.io/docs/introduction/faq/#what-is-tinas-tech-stack

Roadmap

Our development priorities can be read on our Public Roadmap.

Contributing

Please see our ./CONTRIBUTING.md

Maintainers

View our awesome SSW devs at ssw.com.au/people.

NPM DownloadsLast 30 Days