Skip to content

Custom UI Components

Sometimes you want to customize UI elements to maintain consistency with your application's design system. vue-stream-markdown provides the ability to replace any built-in UI component with your own implementation, giving you full control over the look and feel of your markdown content.

Example

Customize the Button component:

vue
<script setup lang="ts">
import type { UIButtonProps } from 'vue-stream-markdown'

const props = defineProps<UIButtonProps>()
</script>

<template>
  <button>{{ props.name }}</button>
</template>
vue
<script setup lang="ts">
import MyButton from './Button.vue'
</script>

<template>
  <Markdown
    :components="{ Button: MyButton }"
    :content="content"
  />
</template>

Available Components

ComponentProps TypeDescription
AlertUIAlertPropsAlert modal component
ButtonUIButtonPropsButton component
Caret-Cursor/caret indicator
CodeBlockCodeNodeRendererPropsCode block wrapper
DropdownUIDropdownPropsDropdown menu
ErrorComponentUIErrorComponentPropsError display
IconUIIconPropsIcon component
ImageUIImagePropsImage with zoom
ModalUIModalPropsModal dialog
SegmentedUISegmentedPropsSegmented control
Spin-Loading spinner
TableUITablePropsTable component
TooltipUITooltipPropsTooltip component
ZoomContainerUIZoomContainerPropsZoom wrapper