vue3-baseblock
v1.0.0
Published
Simple Reusable Vue 3 BaseBlock component
Readme
vue3-baseblock
Reusable Vue 3 VueBaseBlock component with fullscreen and collapsible content.
Install
npm install vue3-baseblockyarn add vue3-baseblockUsage
<script setup lang="ts">
import VueBaseBlock from "vue3-baseblock";
import "vue3-baseblock/style.css";
</script>
<template>
<VueBaseBlock title="Example" bordered rounded>
<p>Hello from VueBaseBlock.</p>
</VueBaseBlock>
</template>Props
title(string, default:"")titleClass(string, default:"")subtitle(string, default:"")subTitleClass(string, default:"")bordered(boolean, default:false)rounded(boolean, default:true)transparent(boolean, default:false)fxPop(boolean, default:false)fxRotateRight(boolean, default:false)fxRotateLeft(boolean, default:false)headerClass(string, default:"")optionsClass(string, default:"")contentClass(string, default:"")footerClass(string, default:"")rootClass(string, default:"")headerTitleClass(string, default:"")noFooter(boolean, default:false)headerRtl(boolean, default:false)modeLoading(boolean, default:false)modeFullscreen(boolean, default:false)modeContentHide(boolean, default:false)modeClose(boolean, default:false)btnOptionFullscreen(boolean, default:false)btnOptionFullscreenIconClass(string, default:"")btnOptionContent(boolean, default:false)btnOptionClose(boolean, default:false)blockId(string, default:"@")headerUppercase(boolean, default:false)cursorClass(string, default:"default")showSearcher(boolean, default:false)
Events
content-hidecontent-showfull-screennormal-screenclose(payload:blockId)header-clicked
Slots
defaultheadertitlesubtitleoptionscustomcontentfootersearcher
Exposed methods
Call via template ref.
fullscreenToggle()fullscreenOn()fullscreenOff()contentToggle()contentShow()contentHide()statusToggle()statusLoading()statusNormal()open()close()
Styling
All internal classes are prefixed with __ so they can be overridden easily. The component ships with its own CSS file.
import "vue3-baseblock/style.css";VueBaseBlock defaults to full width (width: 100%). Override with a custom class if needed.
Default backgrounds use low-specificity rules, so setting background on your custom class (e.g., rootClass or headerClass) will override without !important.
Internal class hooks
Use these classes to override styles from your app CSS:
__block__block-bordered__block-rounded__block-transparent__block-fx-pop__block-fx-rotate-right__block-fx-rotate-left__block-mode-loading__block-mode-fullscreen__block-mode-hidden__block-header__block-header-default__block-header-rtl__block-title__block-title-uppercase__block-options__btn-block-option__btn-muted__icon__icon-close__icon-fullscreen__icon-fullscreen-exit__icon-chevron__icon-chevron-up__icon-chevron-down__block-body__block-body-hidden__block-content__block-content-sm__block-content-full__block-footer__block-footer-hidden__content-custom__block-loading__block-spinner__space-x-1
