Tampa, Florida
Posts

Using custom components in markdown

April 20, 2025
Magic Portfolio will replace some default HTML elements to Once UI components to integrate better in the design and add additional functionality. Furthermore, many common Once UI components are already imported and available for use. The feedback component is used to display critical information to visitors. Tables are used to display data in a structured format. Use the CodeBlock component to display code snippets with code highlighting, preview, and copy to clipboard functionality. Use the InlineCode component for inline code snippets. The code block component works based on Once UI's CodeBlock. You can access it with the complete syntax for full customization, or by using the standard markdown syntax (triple backticks) with pre-configured props. The InlineCode is another Once UI component that you can access either through the complete syntax or the short syntax (backticks). Usually the standard markdown syntax is recommended, since it doesn't have that much configuration options. Accordions are used to toggle between hiding and showing content. Buttons are used to trigger actions or navigate to other pages. Cards are used to group related content and actions. Icons are used to visually represent actions, objects, or concepts. For instructions on importing new icons, head over to the Once UI documentation. Layout components help structure content on the page. The Flex component is accessible as Column and Row and can handle a wide range of layout options and style properties. Use the grid to construct responsive grid layouts. It can be styled similarly to the Flex element. Media provides an optimized way to display images. Access it with the Media component for full customization or use the markdown syntax. You can also use it to embed YouTube videos. SmartLink provides an enhanced way to link to internal and external resources. You can access it with the SmartLink component for full customization or with the standard markdown syntax. Since Magic Portfolio is based on Once UI, you can use all the components provided by Once UI in the .mdx files, but you need to import them first in the src/product/mdx.tsx file and pass it to the components object.
On this page