Component Library
π Noteβ
You can use tailwind in classNames (cheatsheet).
All code here can be used directly in an .mdx
document as is.
Some components will require importing, some are available globally via MDXComponents.ts
file. This will be specified in each example.
If a component is failing, check the component's interface - you are probably missing a required prop.
This page is also an .mdx
document that uses both markdown and JSX components.
Scroll down and click on "Β EditΒ thisΒ page" link to see the mdx raw source code.
Hint: When in github,
π raw mdx files can be viewed by clicking on the "Raw" button.
π press .
on a keyboard, which will open the file interactively in a browser VSCode.
π In VSCode, you can press Ctrl+P
to quickly navigate between files by name.
CardLinkβ
Show code
See more complex examples below.
CardLinkGroupβ
Show code
description with image.
Other cards in row will stretch vertically.
Iconβ
See Icons for a list of available IconKeys.
Show code
IconButtonβ
Show code
ImageCard (link)β
When href
is provided, the card will function as a link.
Images can be stored in /static/img/*
folder and linked with e.g. src="/img/core.gif"
.
Show code

label
description
TypeLabelβ
import { TypeLabel } from '@site/src/components/TypeLabel'
// Required
<TypeLabel isRequired>string</TypeLabel>
// Default value
<TypeLabel className="my-4" defaultValue={0}>number</TypeLabel>
// With link
<TypeLabel isRequired link="https://github.com/wevm/viem/blob/main/src/types/eip1193.ts#L26">
EIP1193Provider
</TypeLabel>