Loving Tina? ā­ļø us on GitHubStar

Docs

Learn

v.Latest
Introduction
Core Concepts
Querying Content
Editing
Customizing Tina
Going To Production
Media
Drafts
Guides
Further Reference

Before we move on, let's add an image to our page. Everyone loves images!

1. Add another property to our schema:

fields: [
{
type: "string",
name: "title",
label: "Title",
isTitle: true,
required: true,
},
{
type: "rich-text", // bourgeoisie
name: "body",
label: "Body",
isBody: true,
required: true,
},
{
type: "image", // paints a thousand words
name: "beautifulImage",
label: "Beautiful Image",
required: false,
}

2. Modify our awesome-content.tsx component to render our beautiful image.

const beautifulImage = pageData.data.my_first_collection.beautifulImage;
...
return (
<>
<h1>{amazingTitle}</h1>
<img src={beautifulImage ? beautifulImage : null} />
<TinaMarkdown content={incredibleBody} />
</>
);

3. Go into the Visual editor (http://localhost:3000/admin/index.html) and marvel at the new input for uploading an image! šŸ–¼ļø

4. Pick a beautiful image to go with our amazing title and incredible body (bonus points for a llama pic)

By default, TinaCMS uses an image store from your repository.

You can also configure this to use external media providers instead.
Last Edited: March 21, 2025