Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

rspress-plugin-align-image

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rspress-plugin-align-image

Rspress plugin for aligning images

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
2
Created
Source

rspress-plugin-align-image NPM Version

简体中文

Rspress plugin to align images in markdown.

This plugin works by wrapping images in a div element with classes that aligns the image.

Usage

npm i rspress-plugin-align-image
pnpm add rspress-plugin-align-image
import * as path from 'path';
import { defineConfig } from 'rspress/config';
import alignImage from 'rspress-plugin-align-image';

export default defineConfig({
  root: path.join(__dirname, 'docs'),
  plugins: [alignImage()],
});

Configure

justify

Align the image to the left, right or center.

  • Type: 'left' | 'right' | 'center'
  • Default: 'center'

containerClassNames

Addtional class names to add to the container div element.

  • Type: string[]
import * as path from 'path';
import { defineConfig } from 'rspress/config';
import alignImage from 'rspress-plugin-align-image';

export default defineConfig({
  root: path.join(__dirname, 'docs'),
  plugins: [
    alignImage({
      justify: 'left',
      containerClassNames: ['my-class'],
    }),
  ],
});

The configuration above will align the image to the left and add the class my-class to the container div element:

<div class="my-4 flex flex-row justify-start my-class">
  <img src="image.jpg" />
</div>

Keywords

rspress

FAQs

Package last updated on 07 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts