Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Media Grid

subhash-sarangisubhash-sarangi145 downloads

Wrap media inside a grid layout.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates4

An obsidian plugin to wrap media inside a grid or a flexbox layout

```media-grid
cols: <no. of columns per row>
gap: <grid-gap>
grid-container-id: <grid container element's id>

![[image-1.png]]
![[image-2.png]]
![[video-1.png]]
![[image-3.png]]
![[video-2.png]]
![[image-4.png]]
```

Supported Media

Image extensions: ['jpg', 'jpeg', 'png', 'webp']
Video extensions: ['mp4']

Anything beyond these file extensions will be treated as unknown format and an error callout will be rendered.

NOTE: Media format is completed derived from the file extension and NOT file metadata. So it is possible to trick Obsidian into attempting to render an invalid file just by renaming the extension.

Config

Property Type Description Default value Notes
cols number | null Number of columns to render in the grid. If omitted, the plugin uses a flexbox layout instead. null ^1
gap number Gap between rows and column 4 ^2
grid-container-id string An unique id to be assigned the rendered grid container - ^3

Grid vs Flex

Use cols when you want a strict CSS grid with a fixed number of columns per row. If cols is omitted, the plugin falls back to a flexbox layout where each row is defined by a blank line and the media items in that row wrap naturally.

Grid example:
```media-grid
cols: 3
gap: 4

![[image-1.png]]
![[image-2.png]]
![[image-3.png]]
![[image-4.png]]
![[video-5.png]]
![[video-6.png]]
```

Renders the media files in a grid with 3 columns

Flex example:
```media-grid
gap: 4

![[image-1.png]]
![[image-2.png]]

![[image-3.png]]
![[image-4.png]]
```

Renders the media files in a grid with 2 rows (2 groups separated by a blank line)

I got the flexbox idea from this, a simple but extremely powerful css snippet which does almost 90% of what this plugin can do lol. I highly recommend checking it out.

Notes

  • Keep each config property and media file in its own separate line
  • If cols is omitted, the plugin uses a flexbox layout instead of a CSS grid.
  • If a grid row contains images of different height, the row's height will be set to that of the image with maximum height leaving any unwanted space around smaller images. Autoscaling images was intentionally left out so as to not strech/shrink images. If per image customization is required, you may still use the grid-container-id and customize with css.

Installation Instructions

Refer these instructions to try it out locally

Todo

  • Basic grid
    • cols, gap and gridContainerId
  • Image rendering
  • Media size
  • Video rendering
  • column gap and row gap

[^1] Use cols when you want a strict CSS grid with a fixed number of columns per row. If cols is omitted, the plugin falls back to a flexbox layout where each row is defined by a blank line.
[^2] Css grid does support different gaps for rows and columns. But, as of now, this plugin doesn't support that. The same gap will be used for both rows and columns.
[^3] Grid container id can be used to further customize the grid behaviour using css snippets.

Feel free to contribute
HealthExcellent
ReviewPassed
About
Wrap local images and MP4 videos into a customizable grid using a simple block syntax. Set columns, gap and a container id for CSS targeting; supports jpg/jpeg/png/webp images and mp4 videos and renders an error callout for unsupported extensions. Match row height to the tallest item to preserve media dimensions.
ImagesVideoAttachments
Details
Current version
1.1.0
Last updated
Last month
Created
Last month
Updates
4 releases
Downloads
145
Compatible with
Obsidian 1.12.7+
Platforms
Desktop only
License
MIT
Report bugRequest featureReport plugin
Author
subhash-sarangisubhash-sarangi
GitHubsubhash3
  1. Community
  2. Plugins
  3. Images
  4. Media Grid

Related plugins

Ink

Handwriting and drawing directly between paragraphs using a digital pen, stylus, or Apple pencil.

Pixel Perfect Image

Pixel perfect 100% image resizing, copy to clipboard, show image in Finder/Explorer, and much more.

Local Images Plus

A reincarnation of Local Images to download images in Markdown notes to local storage.

Image Context Menus

Image context menus (mostly on right click): Copy to clipboard, Open in default app, Show in system explorer, Reveal file in navigation, Open in new tab.

Pixel Banner

Enhance your notes with customizable banner images.

Paste image rename

Rename image after pasting, support name pattern and auto renaming.

Image auto upload

Upload images from your clipboard by PicGo.

Imgur

Upload images from your clipboard to imgur.com and embeds uploaded image to your note.

CMDS Eagle

Connect Eagle asset library to Obsidian. Search, embed, and upload images to cloud (ImgHippo, R2, S3, WebDAV).

S3 Image Uploader

Self-host images on AWS S3.