Common copmponents compilation

Written by
auth-avtHieu.BuiMinh
Published onAugust 2, 2024
Views0
Comments0

In this post, I'll share the MDX components I frequently use in my projects and how they render visually. From interactive buttons and code blocks to custom alert messages and image components, I'll walk you through the design and usage of each one.

Heading 2:

Heading 3...

Heading 4...

Heading 5...
Heading 6...

Paragraphs:

Lorem ipsum odor amet, consectetuer adipiscing elit.

Lorem ipsum odor amet, consectetuer adipiscing elit.

Lorem ipsum odor amet, consectetuer adipiscing elit.

Lorem ipsum odor amet, consectetuer adipiscing elit.

Lorem ipsum odor amet, consectetuer adipiscing elit.

Lorem ipsum odor amet, consectetuer adipiscing elit.

Lorem ipsum odor amet, consectetuer adipiscing elit.

Blockquotes:

Lorem ipsum odor amet, consectetuer adipiscing elit. Lorem ipsum odor amet, consectetuer adipiscing elit. Lorem ipsum odor amet, consectetuer adipiscing elit.

The problem is not the problem. The problem is your attitude about the problem

https://i.imgur.com/QMdUKB7.jpeg

Captain Jack Sparrow 🐦

-Pirates of the Caribbean-

Bullet list:

  1. First item
  2. Second item
  3. Third item
    1. Indented item
    2. Indented item
  4. Fourth item
  • First item
  • Second item
  • Third item
    • Indented item
    • Indented item
  • Fourth item

Code block:

component.tsx
export default async function BlogDetailPageView({ params }: PostPageProps) {
	const post = await getPostFromParams(params)
 
	if (!post || !post.published) {
		notFound()
	}
 
	return (
		<div className="relative flex justify-between gap-10">
			<article className="prose max-w-full dark:prose-invert lg:max-w-[calc(100%-220px)]">
				<MDXContent code={post.body} />
			</article>
 
			<aside className="hidden lg:block lg:w-[220px]">
				<div className="sticky top-16 z-10 flex flex-col gap-4">
					<TableOfContent post={post} />
					<PostLikeButton post={post} />
				</div>
			</aside>
		</div>
	)
}

I love supporting the EFF.

This is the Markdown Guide.

See the section on code.

Images:

image-alt

Cloudinary image

Tree view:

page.tsx
page.tsx
layout.tsx

heading.tsx
mdx.tsx

hello-world.mdx

...velite auto genarating json files
blog.json
package.json
next.config.mjs
velite.config.ts

Image list:

Lorem ipsum odor amet, consectetuer adipiscing elit. Nibh ipsum nostra ultricies montes curabitur conubia orci aliquam. Ridiculus venenatis tempor placerat urna turpis sagittis at. Enim nunc adipiscing ridiculus tortor, placerat malesuada metus

Video

Cloudinary video

Task list:

  • Write the press release
  • Update the website
  • Contact the media

Table:

ExampleDescriptionRules
$valueLowercase
$ValueUppercase
$_valueUnderscore
$1valueStart from number
Last updated: January 30, 2025